diff --git a/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java b/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java index 809f9463aa6..17ea6e8c146 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java @@ -154,6 +154,7 @@ public class TestConcurrentMergeScheduler extends LuceneTestCase { IndexWriter writer = new IndexWriter( directory, newIndexWriterConfig(new MockAnalyzer(random())).setMergePolicy(mp)); + TestUtil.reduceOpenFiles(writer); Document doc = new Document(); Field idField = newStringField("id", "", Field.Store.YES); @@ -779,6 +780,7 @@ public class TestConcurrentMergeScheduler extends LuceneTestCase { IndexWriterConfig iwc = newIndexWriterConfig(new MockAnalyzer(random())); iwc.setMergePolicy(NoMergePolicy.INSTANCE); iwc.setMaxBufferedDocs(2); + iwc.setUseCompoundFile(true); // reduce open files IndexWriter w = new IndexWriter(dir, iwc); int numDocs = TEST_NIGHTLY ? 1000 : 100; for (int i = 0; i < numDocs; i++) { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterThreadsToSegments.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterThreadsToSegments.java index c2d601e20d6..b4617edbc82 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterThreadsToSegments.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterThreadsToSegments.java @@ -258,6 +258,7 @@ public class TestIndexWriterThreadsToSegments extends LuceneTestCase { IndexWriterConfig iwc = newIndexWriterConfig(r, new MockAnalyzer(r)); iwc.setCommitOnClose(false); final RandomIndexWriter w = new RandomIndexWriter(r, dir, iwc); + TestUtil.reduceOpenFiles(w.w); w.setDoRandomForceMerge(false); Thread[] threads = new Thread[TestUtil.nextInt(random(), 4, 30)]; final CountDownLatch startingGun = new CountDownLatch(1);