mirror of https://github.com/apache/lucene.git
Fix too many open files Exception for some tests (#13035)
* init * fix review * fix review * iter
This commit is contained in:
parent
9a88d8ad25
commit
55df3e02f3
|
@ -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++) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue