Skip to content

Apache Lucene open-source search software

Fix testGraphMergeWithDeletes test case to have atleast one vector (#15487)

Pulkit Gupta94312d0f3739
diff --git a/lucene/core/src/test/org/apache/lucene/util/hnsw/HnswGraphTestCase.java b/lucene/core/src/test/org/apache/lucene/util/hnsw/HnswGraphTestCase.java
index 97ea04d2da8..db3c590d920 100644
--- a/lucene/core/src/test/org/apache/lucene/util/hnsw/HnswGraphTestCase.java
+++ b/lucene/core/src/test/org/apache/lucene/util/hnsw/HnswGraphTestCase.java
@@ -212,7 +212,7 @@ abstract class HnswGraphTestCase<T> extends LuceneTestCase {
int M = 4;
int beamWidth = 20;
String vectorFieldName = "vec1";
- int numVectors = random().nextInt(1000);
+ int numVectors = random().nextInt(1000) + 1;
int deletionProbaility = random().nextInt(100);
int dim = random().nextInt(64) + 1;
if (dim % 2 == 1) {