LUCENE-6122: always set CMS settings in LuceneTestCase.newIndexWriterConfig

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1646850 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2014-12-19 19:46:55 +00:00
parent 72d3f29460
commit 1725dabf45
1 changed files with 11 additions and 0 deletions

View File

@ -920,7 +920,18 @@ public abstract class LuceneTestCase extends Assert {
int maxMergeCount = TestUtil.nextInt(r, maxThreadCount, maxThreadCount + 4);
cms.setMaxMergesAndThreads(maxMergeCount, maxThreadCount);
c.setMergeScheduler(cms);
} else {
// Always use consistent settings, else CMS's dynamic (SSD or not)
// defaults can change, hurting reproducibility:
ConcurrentMergeScheduler cms = new ConcurrentMergeScheduler();
// Only 1 thread can run at once (should maybe help reproducibility),
// with up to 3 pending merges before segment-producing threads are
// stalled:
cms.setMaxMergesAndThreads(3, 1);
c.setMergeScheduler(cms);
}
if (r.nextBoolean()) {
if (rarely(r)) {
// crazy value