mirror of https://github.com/apache/lucene.git
LUCENE-10069: Adjust TestKnnVectorQuery#testRandom to stop failures
The test fails randomly because HNSW can sometimes miss results when k is close to the number of total docs. While we wait for a fix, this commit decreases k to prevent failures.
This commit is contained in:
parent
5871ea7972
commit
b2a04a4bb4
lucene/core/src/test/org/apache/lucene/search
|
@ -285,7 +285,7 @@ public class TestKnnVectorQuery extends LuceneTestCase {
|
|||
try (IndexReader reader = DirectoryReader.open(d)) {
|
||||
IndexSearcher searcher = newSearcher(reader);
|
||||
for (int i = 0; i < numIters; i++) {
|
||||
int k = random().nextInt(100) + 1;
|
||||
int k = random().nextInt(80) + 1;
|
||||
KnnVectorQuery query = new KnnVectorQuery("field", randomVector(dimension), k);
|
||||
int n = random().nextInt(100) + 1;
|
||||
TopDocs results = searcher.search(query, n);
|
||||
|
|
Loading…
Reference in New Issue