This is an automated email from the ASF dual-hosted git repository.
shashikant pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ratis.git
The following commit(s) were added to refs/heads/master by this push:
new c48b0e4 RATIS-1021. Fix failed UT: testMultipleLinearRandomRetry
(#166)
c48b0e4 is described below
commit c48b0e4507208f0ffa4618efd33bd98a8f9b4649
Author: runzhiwang <[email protected]>
AuthorDate: Wed Aug 5 13:01:15 2020 +0800
RATIS-1021. Fix failed UT: testMultipleLinearRandomRetry (#166)
---
.../java/org/apache/ratis/retry/TestMultipleLinearRandomRetry.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/ratis-test/src/test/java/org/apache/ratis/retry/TestMultipleLinearRandomRetry.java
b/ratis-test/src/test/java/org/apache/ratis/retry/TestMultipleLinearRandomRetry.java
index 9d24c27..09ae55f 100644
---
a/ratis-test/src/test/java/org/apache/ratis/retry/TestMultipleLinearRandomRetry.java
+++
b/ratis-test/src/test/java/org/apache/ratis/retry/TestMultipleLinearRandomRetry.java
@@ -60,6 +60,7 @@ public class TestMultipleLinearRandomRetry extends BaseTest {
@Test
public void testMultipleLinearRandomRetry() {
+ double precision = 0.00000001;
final int[] counts = {10, 20, 30};
final TimeDuration[] times = {HUNDRED_MILLIS, ONE_SECOND, FIVE_SECONDS};
final MultipleLinearRandomRetry r = assertLegalInput("[10x100ms, 20x1s,
30x5s]", "100ms,10, 1s,20, 5s,30");
@@ -74,7 +75,7 @@ public class TestMultipleLinearRandomRetry extends BaseTest {
final long d = expected.getDuration();
LOG.info("times[{},{}] = {}, randomized={}", i, j, times[i],
randomized);
Assert.assertTrue(randomized.getDuration() >= d*0.5);
- Assert.assertTrue(randomized.getDuration() < d*1.5);
+ Assert.assertTrue(randomized.getDuration() < (d*1.5 + precision));
}
}