From 02e285f6ce14df617a39be3f7d789a9e545d00ec Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Thu, 27 Jun 2013 16:22:31 +0000 Subject: [PATCH] randomize CMS a little bit git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1497422 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/java/org/apache/lucene/util/LuceneTestCase.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java index 9ab18a1ed89..30550328554 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java @@ -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)) {