diff --git a/src/test/java/org/opensearch/knn/index/codec/KNNCodecTestCase.java b/src/test/java/org/opensearch/knn/index/codec/KNNCodecTestCase.java index c9a1900b5..6bfde31bb 100644 --- a/src/test/java/org/opensearch/knn/index/codec/KNNCodecTestCase.java +++ b/src/test/java/org/opensearch/knn/index/codec/KNNCodecTestCase.java @@ -122,6 +122,7 @@ public void testMultiFieldsKnnIndex(Codec codec) throws Exception { IndexWriterConfig iwc = newIndexWriterConfig(); iwc.setMergeScheduler(new SerialMergeScheduler()); iwc.setCodec(codec); + // Set merge policy to no merges so that we create a predictable number of segments. iwc.setMergePolicy(NoMergePolicy.INSTANCE); /**