fix test bug causing false failure

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1592756 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2014-05-06 14:26:57 +00:00
parent 15f1d9416a
commit 090b804efc
1 changed files with 4 additions and 1 deletions

View File

@ -88,6 +88,9 @@ public final class TestRateLimiter extends LuceneTestCase {
// TODO: this may false trip .... could be we can only assert that it never exceeds the max, so slow jenkins doesn't trip:
double ratio = actualMBPerSec/targetMBPerSec;
assertTrue("targetMBPerSec=" + targetMBPerSec + " actualMBPerSec=" + actualMBPerSec, ratio >= 0.9 && ratio <= 1.1);
// Only enforce that it wasn't too fast; if machine is bogged down (can't schedule threads / sleep properly) then it may falsely be too slow:
//assertTrue("targetMBPerSec=" + targetMBPerSec + " actualMBPerSec=" + actualMBPerSec, ratio >= 0.9 && ratio <= 1.1);
assertTrue("targetMBPerSec=" + targetMBPerSec + " actualMBPerSec=" + actualMBPerSec, ratio <= 1.1);
}
}