lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject [3/4] lucene-solr:master: Fix test failure when floorSegmentMB > maxMergedSegmentMB.
Date Wed, 12 Dec 2018 12:22:10 GMT
Fix test failure when floorSegmentMB > maxMergedSegmentMB.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/55993ecb
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/55993ecb
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/55993ecb

Branch: refs/heads/master
Commit: 55993ecb9b06d9c0d2bd54a752a08f19698a13bc
Parents: 21dc237
Author: Adrien Grand <jpountz@gmail.com>
Authored: Wed Dec 12 13:21:06 2018 +0100
Committer: Adrien Grand <jpountz@gmail.com>
Committed: Wed Dec 12 13:21:06 2018 +0100

----------------------------------------------------------------------
 .../src/test/org/apache/lucene/index/TestTieredMergePolicy.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/55993ecb/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java
index b4a7ff5..bbc8051 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java
@@ -169,7 +169,8 @@ public class TestTieredMergePolicy extends BaseMergePolicyTestCase {
       }
       w.forceMerge(targetCount);
 
-      final long max125Pct = (long) ((tmp.getMaxMergedSegmentMB() * 1024.0 * 1024.0) * 1.25);
+      final double maxSegmentSize = Math.max(tmp.getMaxMergedSegmentMB(), tmp.getFloorSegmentMB());
+      final long max125Pct = (long) ((maxSegmentSize * 1024.0 * 1024.0) * 1.25);
       // Other than in the case where the target count is 1 we can't say much except no segment
should be > 125% of max seg size.
       if (targetCount == 1) {
         assertEquals("Should have merged down to one segment", targetCount, w.getSegmentCount());


Mime
View raw message