mirror of https://github.com/apache/lucene.git
invoke cms parameters randomly
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1593393 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b943e47c99
commit
1b0834ec83
|
@ -84,6 +84,7 @@ import org.apache.lucene.index.LogByteSizeMergePolicy;
|
|||
import org.apache.lucene.index.LogDocMergePolicy;
|
||||
import org.apache.lucene.index.LogMergePolicy;
|
||||
import org.apache.lucene.index.MergePolicy;
|
||||
import org.apache.lucene.index.MergeScheduler;
|
||||
import org.apache.lucene.index.MockRandomMergePolicy;
|
||||
import org.apache.lucene.index.MultiDocValues;
|
||||
import org.apache.lucene.index.MultiFields;
|
||||
|
@ -1082,7 +1083,17 @@ public abstract class LuceneTestCase extends Assert {
|
|||
c.setCheckIntegrityAtMerge(r.nextBoolean());
|
||||
}
|
||||
|
||||
// TODO: mergepolicy, mergescheduler, etc have mutable state on indexwriter
|
||||
if (rarely(r)) {
|
||||
// change CMS merge parameters
|
||||
MergeScheduler ms = c.getMergeScheduler();
|
||||
if (ms instanceof ConcurrentMergeScheduler) {
|
||||
int maxThreadCount = TestUtil.nextInt(random(), 1, 4);
|
||||
int maxMergeCount = TestUtil.nextInt(random(), maxThreadCount, maxThreadCount + 4);
|
||||
((ConcurrentMergeScheduler)ms).setMaxMergesAndThreads(maxMergeCount, maxThreadCount);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: mergepolicy, etc have mutable state on indexwriter
|
||||
// every setter must be tested
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue