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
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopFieldDocs;
import org.apache.lucene.search.join.QueryBitSetProducer;
import org.apache.lucene.search.join.ScoreMode;
import org.apache.lucene.search.join.ToParentBlockJoinQuery;
import org.apache.lucene.tests.util.TestUtil;
import org.apache.lucene.util.Accountable;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.FixedBitSet;
import org.apache.lucene.util.UnicodeUtil;
import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader;
import org.elasticsearch.common.lucene.search.Queries;
import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested;
import org.elasticsearch.index.fielddata.fieldcomparator.BytesRefFieldComparatorSource;
import org.elasticsearch.index.fielddata.ordinals.GlobalOrdinalsIndexFieldData;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.search.MultiValueMode;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.lessThanOrEqualTo;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.sameInstance;
public abstract class AbstractStringFieldDataTestCase extends AbstractFieldDataImplTestCase {