diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 05d99b76911..0c6b96af9c6 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -187,6 +187,8 @@ Other * LUCENE-8993, LUCENE-8807: Changed all repository and download references in build files to HTTPS. (Uwe Schindler) +* LUCENE-8998: Fix OverviewImplTest.testIsOptimized reproducible failure. (Tomoko Uchida) + ======================= Lucene 8.2.0 ======================= API Changes diff --git a/lucene/luke/src/test/org/apache/lucene/luke/models/overview/OverviewTestBase.java b/lucene/luke/src/test/org/apache/lucene/luke/models/overview/OverviewTestBase.java index 5554d709941..f1516174250 100644 --- a/lucene/luke/src/test/org/apache/lucene/luke/models/overview/OverviewTestBase.java +++ b/lucene/luke/src/test/org/apache/lucene/luke/models/overview/OverviewTestBase.java @@ -28,6 +28,8 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; import org.apache.lucene.util.LuceneTestCase; @@ -55,7 +57,9 @@ public abstract class OverviewTestBase extends LuceneTestCase { Path indexDir = createTempDir(); Directory dir = newFSDirectory(indexDir); - RandomIndexWriter writer = new RandomIndexWriter(random(), dir, new MockAnalyzer(random())); + IndexWriterConfig config = new IndexWriterConfig(new MockAnalyzer(random())); + config.setMergePolicy(NoMergePolicy.INSTANCE); // see LUCENE-8998 + RandomIndexWriter writer = new RandomIndexWriter(random(), dir, config); Document doc1 = new Document(); doc1.add(newStringField("f1", "1", Field.Store.NO));