diff --git a/prj/test/functional/executor/src/main/java/executor/CESJavaSingleClusterTests.java b/prj/test/functional/executor/src/main/java/executor/CESJavaSingleClusterTests.java index 44295f304bc6..31c252a30e21 100644 --- a/prj/test/functional/executor/src/main/java/executor/CESJavaSingleClusterTests.java +++ b/prj/test/functional/executor/src/main/java/executor/CESJavaSingleClusterTests.java @@ -50,6 +50,10 @@ import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.both; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.lessThanOrEqualTo; + import static org.junit.Assert.fail; @@ -107,7 +111,10 @@ public void shouldUseDefaultExecutor() protected void validateMetrics() { - Eventually.assertDeferred(this::getCompletedMetricsAggregate, is(23L)); + // range check as some tasks may be cancelled, which is fine + // given the api calls + Eventually.assertDeferred(this::getCompletedMetricsAggregate, + is(both(greaterThan(20L)).and(lessThanOrEqualTo(23L)))); } protected long getCompletedMetricsAggregate()