diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSegmentToThreadMapping.java b/lucene/core/src/test/org/apache/lucene/index/TestSegmentToThreadMapping.java index 62299dfd919..5ea8f835fee 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSegmentToThreadMapping.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSegmentToThreadMapping.java @@ -255,7 +255,7 @@ public class TestSegmentToThreadMapping extends LuceneTestCase { List leafReaderContexts = new ArrayList<>(); int max = 500_000; int min = 10_000; - int numSegments = random().nextInt(50); + int numSegments = 1 + random().nextInt(50); for (int i = 0; i < numSegments; i++) { leafReaderContexts.add(new LeafReaderContext(dummyIndexReader(random().nextInt((max - min) + 1) + min)));