To reproduce: 

```
./gradlew ':server:test' --tests "org.elasticsearch.index.engine.InternalEngineTests.testGetWithSearcherWrapper" -Dtests.seed=F9FA60B1031E3AA3 -Dtests.locale=ro -Dtests.timezone=Portugal -Druntime.java=21
```

It fails on the 8.11 branch. I tested against 3 SHAs and it failed on all:

35ef8a1d795fc62115db44604447e91e27a4403f
848fb3316d986cb27bc29b20ad7a99dab479c8fb
65167f95eb302f8fcf6fd88c8d1f8d6e7ac9b07d (oldest)

Failure message:

```
org.elasticsearch.index.engine.InternalEngineTests > testGetWithSearcherWrapper FAILED
    java.lang.AssertionError: expected:<0> but was:<1>
        at __randomizedtesting.SeedInfo.seed([F9FA60B1031E3AA3:E71645F1EB255165]:0)
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.failNotEquals(Assert.java:834)
        at org.junit.Assert.assertEquals(Assert.java:645)
        at org.junit.Assert.assertEquals(Assert.java:631)
        at org.elasticsearch.index.engine.InternalEngineTests.testGetWithSearcherWrapper(InternalEngineTests.java:1110)


Suite: Test class org.elasticsearch.index.engine.InternalEngineTests
  1> [2023-10-06T20:47:42,130][INFO ][o.e.i.e.InternalEngineTests] [testGetWithSearcherWrapper] before test
  1> [2023-10-06T20:47:42,794][INFO ][o.e.i.e.InternalEngineTests] [testGetWithSearcherWrapper] after test
  2> REPRODUCE WITH: ./gradlew ':server:test' --tests "org.elasticsearch.index.engine.InternalEngineTests.testGetWithSearcherWrapper" -Dtests.seed=F9FA60B1031E3AA3 -Dtests.locale=ro -Dtests.timezone=Portugal -Druntime.java=21
  2> java.lang.AssertionError: expected:<0> but was:<1>
        at __randomizedtesting.SeedInfo.seed([F9FA60B1031E3AA3:E71645F1EB255165]:0)
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.failNotEquals(Assert.java:834)
        at org.junit.Assert.assertEquals(Assert.java:645)
        at org.junit.Assert.assertEquals(Assert.java:631)
        at org.elasticsearch.index.engine.InternalEngineTests.testGetWithSearcherWrapper(InternalEngineTests.java:1110)
  2> NOTE: leaving temporary files on disk at: /Users/mpeterson/code/elasticsearch/server/build/testrun/test/temp/org.elasticsearch.index.engine.InternalEngineTests_F9FA60B1031E3AA3-005
  2> NOTE: test params are: codec=Asserting(Lucene95): {value.keyword=PostingsFormat(name=Asserting), _id=PostingsFormat(name=Asserting), value=PostingsFormat(name=Asserting)}, docValues:{_seq_no=DocValuesFormat(name=Lucene90), value.keyword=DocValuesFormat(name=Lucene90), _primary_term=DocValuesFormat(name=Lucene90), _version=DocValuesFormat(name=Lucene90)}, maxPointsInLeafNode=1448, maxMBSortInHeap=6.129392626313548, sim=Asserting(RandomSimilarity(queryNorm=true): {value=DFR I(ne)L3(800.0)}), locale=ro, timezone=Portugal
  2> NOTE: Mac OS X 13.6 aarch64/Oracle Corporation 21 (64-bit)/cpus=10,threads=1,free=478791784,total=536870912
  2> NOTE: All tests run in this JVM: [InternalEngineTests]

Tests with failures:
 - org.elasticsearch.index.engine.InternalEngineTests.testGetWithSearcherWrapper
```

**Build scan:**
https://gradle-enterprise.elastic.co/s/bprhvgcke32lm/tests/:server:test/org.elasticsearch.index.engine.InternalEngineTests/testGetWithSearcherWrapper
**Reproduction line:**
```
./gradlew ':server:test' --tests "org.elasticsearch.index.engine.InternalEngineTests.testGetWithSearcherWrapper" -Dtests.seed=F9FA60B1031E3AA3 -Dtests.locale=ro -Dtests.timezone=Portugal -Druntime.java=21
```

**Applicable branches:**
8.11

**Reproduces locally?:**
Yes

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.index.engine.InternalEngineTests&tests.test=testGetWithSearcherWrapper
**Failure excerpt:**
```
java.lang.AssertionError: expected:<0> but was:<1>

  at __randomizedtesting.SeedInfo.seed([F9FA60B1031E3AA3:E71645F1EB255165]:0)
  at org.junit.Assert.fail(Assert.java:88)
  at org.junit.Assert.failNotEquals(Assert.java:834)
  at org.junit.Assert.assertEquals(Assert.java:645)
  at org.junit.Assert.assertEquals(Assert.java:631)
  at org.elasticsearch.index.engine.InternalEngineTests.testGetWithSearcherWrapper(InternalEngineTests.java:1110)
  at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
  at java.lang.reflect.Method.invoke(Method.java:580)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:48)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
  at java.lang.Thread.run(Thread.java:1583)

```
test/framework/src/main/java/org/elasticsearch/index/engine/EngineTestCase.java
final Engine.EventListener eventListener = new Engine.EventListener() {
        }; 
        final List<ReferenceManager.RefreshListener> extRefreshListenerList = externalRefreshListener == null
            ? emptyList()
            : Collections.singletonList(externalRefreshListener);
        final List<ReferenceManager.RefreshListener> intRefreshListenerList = internalRefreshListener == null
            ? emptyList()
            : Collections.singletonList(internalRefreshListener);
        final LongSupplier globalCheckpointSupplier;
        final Supplier<RetentionLeases> retentionLeasesSupplier;
        if (maybeGlobalCheckpointSupplier == null) {
            assert maybeRetentionLeasesSupplier == null;
            final ReplicationTracker replicationTracker = new ReplicationTracker(
                shardId,
                allocationId.getId(),
                indexSettings,
                randomNonNegativeLong(),
                SequenceNumbers.NO_OPS_PERFORMED,
                update -> {},
                () -> 0L,
                (leases, listener) -> listener.onResponse(new ReplicationResponse()),
                () -> SafeCommitInfo.EMPTY
            );
            globalCheckpointSupplier = replicationTracker;
            retentionLeasesSupplier = replicationTracker::getRetentionLeases;
        } else {
            assert maybeRetentionLeasesSupplier != null;
            globalCheckpointSupplier = maybeGlobalCheckpointSupplier;
            retentionLeasesSupplier = maybeRetentionLeasesSupplier;
        }