Several tests failed in the same way:


- [NoOrdinalsStringFieldDataTests » classMethod](https://gradle-enterprise.elastic.co/s/criyecvbvjcqy/tests/:server:test/org.elasticsearch.index.fielddata.NoOrdinalsStringFieldDataTests)
- [NoOrdinalsStringFieldDataTests » classMethod](https://gradle-enterprise.elastic.co/s/criyecvbvjcqy/tests/:server:test/org.elasticsearch.index.fielddata.NoOrdinalsStringFieldDataTests)
- [SortedSetDVStringFieldDataTests » classMethod](https://gradle-enterprise.elastic.co/s/criyecvbvjcqy/tests/:server:test/org.elasticsearch.index.fielddata.SortedSetDVStringFieldDataTests)
- [SortedSetDVStringFieldDataTests » classMethod](https://gradle-enterprise.elastic.co/s/criyecvbvjcqy/tests/:server:test/org.elasticsearch.index.fielddata.SortedSetDVStringFieldDataTests)
- [PagedBytesStringFieldDataTests » classMethod](https://gradle-enterprise.elastic.co/s/criyecvbvjcqy/tests/:server:test/org.elasticsearch.index.fielddata.PagedBytesStringFieldDataTests)
- [PagedBytesStringFieldDataTests » classMethod](https://gradle-enterprise.elastic.co/s/criyecvbvjcqy/tests/:server:test/org.elasticsearch.index.fielddata.PagedBytesStringFieldDataTests)

**Build scan:**
https://gradle-enterprise.elastic.co/s/criyecvbvjcqy/tests/:server:test/org.elasticsearch.index.fielddata.NoOrdinalsStringFieldDataTests

**Reproduction line:**
```
./gradlew ':server:test' --tests "org.elasticsearch.index.fielddata.NoOrdinalsStringFieldDataTests" -Dtests.seed=6970E66CD7B23E6C -Dtests.locale=en-US -Dtests.timezone=Etc/UTC -Druntime.java=20
```

**Applicable branches:**
main

**Reproduces locally?:**
Yes

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.index.fielddata.NoOrdinalsStringFieldDataTests&tests.test=classMethod

**Failure excerpt:**
```
com.carrotsearch.randomizedtesting.ThreadLeakError: 2 threads leaked from SUITE scope at org.elasticsearch.index.fielddata.NoOrdinalsStringFieldDataTests: 
   1) Thread[id=499, name=LuceneTestCase-44-thread-2, state=WAITING, group=TGRP-NoOrdinalsStringFieldDataTests]
        at java.base/jdk.internal.misc.Unsafe.park(Native Method)
        at java.base/java.util.concurrent.locks.LockSupport.park(LockSupport.java:371)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:519)
        at java.base/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3780)
        at java.base/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3725)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1707)
        at java.base/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:435)
        at java.base/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1623)
   2) Thread[id=498, name=LuceneTestCase-44-thread-1, state=WAITING, group=TGRP-NoOrdinalsStringFieldDataTests]
        at java.base/jdk.internal.misc.Unsafe.park(Native Method)
        at java.base/java.util.concurrent.locks.LockSupport.park(LockSupport.java:371)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:519)
        at java.base/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3780)
        at java.base/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3725)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1707)
        at java.base/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:435)
        at java.base/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1623)

  at __randomizedtesting.SeedInfo.seed([6970E66CD7B23E6C]:0)

```
server/src/test/java/org/elasticsearch/index/fielddata/AbstractStringFieldDataTestCase.java
}
        }
        final IndexFieldData<?> indexFieldData = getForField("value");
        final String missingValue = values[1];
        IndexSearcher searcher = newSearcher(DirectoryReader.open(writer));
        SortField sortField = indexFieldData.sortField(missingValue, MultiValueMode.MIN, null, reverse);
        TopFieldDocs topDocs = searcher.search(
            new MatchAllDocsQuery(),
            randomBoolean() ? numDocs : randomIntBetween(10, numDocs),
            new Sort(sortField)
        );
        assertEquals(numDocs, topDocs.totalHits.value);
        BytesRef previousValue = reverse ? UnicodeUtil.BIG_TERM : new BytesRef();
        for (int i = 0; i < topDocs.scoreDocs.length; ++i) {
            final String docValue = searcher.doc(topDocs.scoreDocs[i].doc).get("value");
            final BytesRef value = new BytesRef(docValue == null ? missingValue : docValue);
            if (reverse) {
                assertTrue(previousValue.compareTo(value) >= 0);
            } else {
                assertTrue(previousValue.compareTo(value) <= 0);
            }
            previousValue = value;
        }
        searcher.getIndexReader().close();
    }
    public void testSortMissingFirst() throws IOException {
        testSortMissing(true, false);
    }
    public void testSortMissingFirstReverse() throws IOException {
        testSortMissing(true, true);