mirror of https://github.com/apache/lucene.git
prevent too many open files in test
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1039068 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3c47af1bf0
commit
66c8234469
|
@ -349,6 +349,9 @@ public class TestIndexWriterReader extends LuceneTestCase {
|
|||
|
||||
void close(boolean doWait) throws Throwable {
|
||||
didClose = true;
|
||||
if (doWait) {
|
||||
mainWriter.waitForMerges();
|
||||
}
|
||||
mainWriter.close(doWait);
|
||||
}
|
||||
|
||||
|
|
|
@ -231,5 +231,11 @@ public class _TestUtil {
|
|||
// keep number of open files lowish
|
||||
LogMergePolicy lmp = (LogMergePolicy) w.getMergePolicy();
|
||||
lmp.setMergeFactor(Math.min(5, lmp.getMergeFactor()));
|
||||
|
||||
MergeScheduler ms = w.getConfig().getMergeScheduler();
|
||||
if (ms instanceof ConcurrentMergeScheduler) {
|
||||
((ConcurrentMergeScheduler) ms).setMaxThreadCount(2);
|
||||
((ConcurrentMergeScheduler) ms).setMaxMergeCount(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue