From 579bbb1cce20e8efffdc74524b82b731aa7f1bf3 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:33:33 -0500 Subject: [PATCH] Fix flaky faiss integration tests (#1635) (#1637) (cherry picked from commit 730b7e430f9b25bfddaddcb7b178e15ac2a3ef06) Signed-off-by: Naveen Tatikonda Co-authored-by: Naveen Tatikonda --- src/test/java/org/opensearch/knn/index/FaissIT.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/opensearch/knn/index/FaissIT.java b/src/test/java/org/opensearch/knn/index/FaissIT.java index 82ac12a73..61b0461ef 100644 --- a/src/test/java/org/opensearch/knn/index/FaissIT.java +++ b/src/test/java/org/opensearch/knn/index/FaissIT.java @@ -232,7 +232,7 @@ public void testEndToEnd_whenMethodIsHNSWFlatAndHasDeletedDocs_thenSucceed() { final Set docIdsToBeDeleted = new HashSet<>(); while (docIdsToBeDeleted.size() < 10) { - docIdsToBeDeleted.add(randomInt(testData.indexData.docs.length)); + docIdsToBeDeleted.add(randomInt(testData.indexData.docs.length - 1)); } for (Integer id : docIdsToBeDeleted) { @@ -741,6 +741,7 @@ public void testIVFSQFP16_whenIndexedAndQueried_thenSucceed() { .field(KNN_ENGINE, FAISS_NAME) .field(METHOD_PARAMETER_SPACE_TYPE, "l2") .startObject(PARAMETERS) + .field(METHOD_PARAMETER_NPROBES, 4) .startObject(METHOD_ENCODER_PARAMETER) .field(NAME, ENCODER_SQ) .startObject(PARAMETERS)