Skip to content

Apache Lucene open-source search software

Fix random test TestDirectoryTaxonomyReader#TestDirectoryTaxonomyReader (#12790)

Egor Potemkine1af4182d607
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java
index 0e79711cb3b..246edff6641 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java
@@ -701,7 +701,7 @@ public class TestDirectoryTaxonomyReader extends FacetTestCase {
threadIterations++) {
// length of the FacetLabel array that we are going to check
- int numOfOrdinalsToCheck = random().nextInt(allOrdinals.length);
+ int numOfOrdinalsToCheck = RandomizedTest.randomIntBetween(1, allOrdinals.length);
int[] ordinals = new int[numOfOrdinalsToCheck];
FacetLabel[] path = new FacetLabel[numOfOrdinalsToCheck];