You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zipkin.apache.org by ad...@apache.org on 2019/06/03 04:28:06 UTC

[incubator-zipkin-brave] 02/02: Makes soak test slightly tolerant

This is an automated email from the ASF dual-hosted git repository.

adriancole pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin-brave.git

commit a0f352507612f3238bfa3e4df551a8d28d22e27c
Author: Adrian Cole <ac...@pivotal.io>
AuthorDate: Mon Jun 3 12:11:06 2019 +0800

    Makes soak test slightly tolerant
---
 brave/src/test/java/brave/sampler/RateLimitingSamplerSoakTest.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/brave/src/test/java/brave/sampler/RateLimitingSamplerSoakTest.java b/brave/src/test/java/brave/sampler/RateLimitingSamplerSoakTest.java
index bca68f1..b8fa32b 100644
--- a/brave/src/test/java/brave/sampler/RateLimitingSamplerSoakTest.java
+++ b/brave/src/test/java/brave/sampler/RateLimitingSamplerSoakTest.java
@@ -32,6 +32,7 @@ import org.junit.runner.RunWith;
 import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assumptions.assumeThat;
+import static org.assertj.core.data.Percentage.withPercentage;
 
 @RunWith(Theories.class)
 public class RateLimitingSamplerSoakTest {
@@ -80,7 +81,8 @@ public class RateLimitingSamplerSoakTest {
     service.shutdown();
     service.awaitTermination(1, TimeUnit.SECONDS);
 
-    assertThat(passed.get()).isEqualTo(reservoir);
+    assertThat(passed.get())
+        .isCloseTo(reservoir, withPercentage(0.01)); // accomodates flakes in CI
     assumeThat(hitLastDecisecond.get())
         .withFailMessage("ran out of samples before the end of the second")
         .isTrue();