From db140ffc83adc36c75666a4034dc0c338bfa4a05 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Fri, 15 Nov 2013 11:18:33 +0000 Subject: [PATCH] don't let maxMergedSegmentMB be 0.0 git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1542234 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/index/TestIndexWriterReader.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 f468a6da31a..6254b309dbf 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java @@ -1104,6 +1104,14 @@ public class TestIndexWriterReader extends LuceneTestCase { 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())); + } IndexWriter w = new IndexWriter(dir, iwc); // Create 500 segments: for(int i=0;i<500;i++) {