Skip to content

Apache Lucene open-source search software

Fix flaky test TestIndexOptions > testMultiValueForcesDeoptimization (#16315)

neoReMinD88f79193b188
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 1325863c597..4f4d1655a28 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -319,6 +319,8 @@ Other
* GITHUB#16308: upgrade opennlp to 2.5.10 (Dawid Weiss)
+* GITHUB#16315: Fix flaky test TestIndexOptions > testMultiValueForcesDeoptimization (neoremind)
+
======================= Lucene 10.5.0 =======================
API Changes
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexOptions.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexOptions.java
index 3c360ac4d8e..9b2a8ea016a 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexOptions.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexOptions.java
@@ -350,6 +350,7 @@ public class TestIndexOptions extends LuceneTestCase {
w.addDocument(Collections.singleton(new Field("foo", "val2", ftB)));
// Doc 3
w.addDocument(Collections.singleton(new Field("foo", "val3", ftB)));
+ w.forceMerge(1);
try (LeafReader r = getOnlyLeafReader(DirectoryReader.open(w))) {
assertEquals(4, r.maxDoc());
}