From db8f24dbadc56f1f5061cc0b2d20bb4059948790 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Thu, 21 Nov 2013 11:16:44 +0000 Subject: [PATCH] fix test bug git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1544118 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/index/TestIndexWriterReader.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java index ef0352f1c29..6304f52cd35 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java @@ -1103,18 +1103,9 @@ public class TestIndexWriterReader extends LuceneTestCase { * writer, we don't see merge starvation. */ public void testTooManySegments() throws Exception { Directory dir = newDirectory(); - IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())); - MergePolicy mp = iwc.getMergePolicy(); - - // If we get TieredMP and it's maxMergedSegmentMB is 0 - // then this test falsely fails: - if (mp instanceof TieredMergePolicy) { - TieredMergePolicy tmp = (TieredMergePolicy) mp; - tmp.setMaxMergedSegmentMB(Math.max(.01, tmp.getMaxMergedSegmentMB())); - if (tmp.getSegmentsPerTier() > 20) { - tmp.setSegmentsPerTier(20); - } - } + // Don't use newIndexWriterConfig, because we need a + // "sane" mergePolicy: + IndexWriterConfig iwc = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())); IndexWriter w = new IndexWriter(dir, iwc); // Create 500 segments: for(int i=0;i<500;i++) {