diff --git a/lucene/src/test/org/apache/lucene/index/TestIndexWriterReader.java b/lucene/src/test/org/apache/lucene/index/TestIndexWriterReader.java index c987aafedc6..7cc33ccf631 100644 --- a/lucene/src/test/org/apache/lucene/index/TestIndexWriterReader.java +++ b/lucene/src/test/org/apache/lucene/index/TestIndexWriterReader.java @@ -128,6 +128,9 @@ public class TestIndexWriterReader extends LuceneTestCase { Directory dir1 = newDirectory(); IndexWriter writer = new IndexWriter(dir1, newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer())); + // test relies on no merges happening below: + ((LogMergePolicy) writer.getMergePolicy()).setMergeFactor(10); + writer.setInfoStream(infoStream); // create the index createIndexNoClose(!optimize, "index1", writer);