Fix test failure when floorSegmentMB > maxMergedSegmentMB.

This commit is contained in:
Adrien Grand 2018-12-12 13:21:06 +01:00
parent 21dc237248
commit 55993ecb9b
1 changed files with 2 additions and 1 deletions

View File

@ -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());