You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by be...@apache.org on 2023/07/20 18:08:28 UTC

[lucene] branch main updated: Fix sorted&unsorted graph test flakiness (#12452)

This is an automated email from the ASF dual-hosted git repository.

benwtrent pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new 59c56a0aed9 Fix sorted&unsorted graph test flakiness (#12452)
59c56a0aed9 is described below

commit 59c56a0aed9a43d24c676376b5d50c5c6518e3bc
Author: Benjamin Trent <be...@gmail.com>
AuthorDate: Thu Jul 20 14:08:21 2023 -0400

    Fix sorted&unsorted graph test flakiness (#12452)
    
    When running HnswGraphTestCase#testSortedAndUnsortedIndicesReturnSameResults, we search two separate graph structures. These structures can change depending on the order of the vectors seen and consequently a different result set could be returned from the same query.
    
    To account for this, the test had a higher number of exploration candidates (ef_search/k) of 50, but in one particular seed: C8AAF5E4648B4226, it failed.
    
    I have verified that bumping the search candidate pool to 60 fixes the failure.
    
    The total number of vectors still out numbers the requested number of candidates, so the search is still hitting the graph.
    
    I verified further by running the test again over a couple thousand seeds and it didn't fail again.
---
 lucene/core/src/test/org/apache/lucene/util/hnsw/HnswGraphTestCase.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 e74660405b0..4c688003d8c 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
@@ -232,7 +232,7 @@ abstract class HnswGraphTestCase<T> extends LuceneTestCase {
         for (int i = 0; i < 10; i++) {
           // ask to explore a lot of candidates to ensure the same returned hits,
           // as graphs of 2 indices are organized differently
-          Query query = knnQuery("vector", randomVector(dim), 50);
+          Query query = knnQuery("vector", randomVector(dim), 60);
           int searchSize = 5;
           List<String> ids1 = new ArrayList<>(searchSize);
           List<Integer> docs1 = new ArrayList<>(searchSize);