LUCENE-8998: Fix OverviewImplTest.testIsOptimized reproducible failure

This commit is contained in:
Tomoko Uchida 2019-10-05 17:15:10 +09:00
parent 22e96697de
commit 42ff080c84
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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));