From 730b7e430f9b25bfddaddcb7b178e15ac2a3ef06 Mon Sep 17 00:00:00 2001 From: Naveen Tatikonda Date: Fri, 19 Apr 2024 20:47:06 -0500 Subject: [PATCH] Fix flaky faiss integration tests (#1635) --- 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 bcefeb7f4..49f74cb7c 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)