Skip to content

Apache Lucene open-source search software

LUCENE-6550: fix test bug: don't try to init BKDDVs with invalid random params

Michael McCandless784c8f06a158
diff --git a/lucene/sandbox/src/test/org/apache/lucene/bkdtree/TestBKDTree.java b/lucene/sandbox/src/test/org/apache/lucene/bkdtree/TestBKDTree.java
index a1ba2103ca4..1ebe75876a5 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/bkdtree/TestBKDTree.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/bkdtree/TestBKDTree.java
@@ -170,7 +170,7 @@ public class TestBKDTree extends LuceneTestCase {
// We rely on docID order:
iwc.setMergePolicy(newLogMergePolicy());
int maxPointsInLeaf = TestUtil.nextInt(random(), 16, 2048);
- int maxPointsSortInHeap = TestUtil.nextInt(random(), 1024, 1024*1024);
+ int maxPointsSortInHeap = TestUtil.nextInt(random(), maxPointsInLeaf, 1024*1024);
Codec codec = TestUtil.alwaysDocValuesFormat(new BKDTreeDocValuesFormat(maxPointsInLeaf, maxPointsSortInHeap));
iwc.setCodec(codec);
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);