diff --git a/lucene/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java b/lucene/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java index 04bc77a94e8..403b53b04ba 100644 --- a/lucene/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java +++ b/lucene/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java @@ -695,12 +695,12 @@ public class TestIndexWriterExceptions extends LuceneTestCase { MockDirectoryWrapper dir = newDirectory(); { - final IndexWriter writer = new IndexWriter( - dir, - newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer). - setMaxBufferedDocs(-1). - setMergePolicy(newLogMergePolicy(10)) - ); + final IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig( + TEST_VERSION_CURRENT, analyzer).setMaxBufferedDocs(-1) + .setMergePolicy( + random.nextBoolean() ? NoMergePolicy.COMPOUND_FILES + : NoMergePolicy.NO_COMPOUND_FILES)); + // don't use a merge policy here they depend on the DWPThreadPool and its max thread states etc. final int finalI = i; Thread[] threads = new Thread[NUM_THREAD];