randomize CMS a little bit

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1497422 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2013-06-27 16:22:31 +00:00
parent 32f4a55a18
commit 02e285f6ce
1 changed files with 7 additions and 0 deletions

View File

@ -737,6 +737,13 @@ public abstract class LuceneTestCase extends Assert {
if (r.nextBoolean()) {
c.setMergeScheduler(new SerialMergeScheduler());
} else if (rarely(r)) {
int maxThreadCount = _TestUtil.nextInt(random(), 1, 4);
int maxMergeCount = _TestUtil.nextInt(random(), maxThreadCount, maxThreadCount+4);
ConcurrentMergeScheduler cms = new ConcurrentMergeScheduler();
cms.setMaxMergeCount(maxMergeCount);
cms.setMaxThreadCount(maxThreadCount);
c.setMergeScheduler(cms);
}
if (r.nextBoolean()) {
if (rarely(r)) {