diff --git a/integration-tests/opentelemetry-quartz/src/test/java/io/quarkus/it/opentelemetry/quartz/OpenTelemetryQuartzTest.java b/integration-tests/opentelemetry-quartz/src/test/java/io/quarkus/it/opentelemetry/quartz/OpenTelemetryQuartzTest.java index 7f3897f6c3671..85b3a1886a077 100644 --- a/integration-tests/opentelemetry-quartz/src/test/java/io/quarkus/it/opentelemetry/quartz/OpenTelemetryQuartzTest.java +++ b/integration-tests/opentelemetry-quartz/src/test/java/io/quarkus/it/opentelemetry/quartz/OpenTelemetryQuartzTest.java @@ -28,9 +28,9 @@ public class OpenTelemetryQuartzTest { @Test public void quartzSpanTest() { // ensure that scheduled job is called - assertCounter("/scheduler/count", 1, Duration.ofSeconds(1)); + assertCounter("/scheduler/count", 3, Duration.ofSeconds(1)); // assert programmatically scheduled job is called - assertCounter("/scheduler/count/manual", 1, Duration.ofSeconds(1)); + assertCounter("/scheduler/count/manual", 3, Duration.ofSeconds(1)); // assert JobDefinition type scheduler assertCounter("/scheduler/count/job-definition", 1, Duration.ofSeconds(1)); @@ -53,6 +53,7 @@ public void quartzSpanTest() { private void assertCounter(String counterPath, int expectedCount, Duration timeout) { await().atMost(timeout) + .pollInterval(Duration.ofMillis(500)) .until(() -> { Response response = given().when().get(counterPath); int code = response.statusCode(); diff --git a/integration-tests/opentelemetry-scheduler/src/test/java/io/quarkus/it/opentelemetry/scheduler/OpenTelemetrySchedulerTest.java b/integration-tests/opentelemetry-scheduler/src/test/java/io/quarkus/it/opentelemetry/scheduler/OpenTelemetrySchedulerTest.java index c33b61ccff386..e53b64051c6e4 100644 --- a/integration-tests/opentelemetry-scheduler/src/test/java/io/quarkus/it/opentelemetry/scheduler/OpenTelemetrySchedulerTest.java +++ b/integration-tests/opentelemetry-scheduler/src/test/java/io/quarkus/it/opentelemetry/scheduler/OpenTelemetrySchedulerTest.java @@ -9,8 +9,10 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.Duration; +import java.time.temporal.TemporalUnit; import java.util.List; import java.util.Map; +import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.Test; @@ -28,9 +30,9 @@ public class OpenTelemetrySchedulerTest { @Test public void schedulerSpanTest() { // ensure that scheduled job is called - assertCounter("/scheduler/count", 1, Duration.ofSeconds(1)); + assertCounter("/scheduler/count", 1, Duration.ofSeconds(3)); // assert JobDefinition type scheduler - assertCounter("/scheduler/count/job-definition", 1, Duration.ofSeconds(1)); + assertCounter("/scheduler/count/job-definition", 1, Duration.ofSeconds(3)); // ------- SPAN ASSERTS ------- List> spans = getSpans(); @@ -48,6 +50,7 @@ public void schedulerSpanTest() { private void assertCounter(String counterPath, int expectedCount, Duration timeout) { await().atMost(timeout) + .pollInterval(Duration.ofMillis(500)) .until(() -> { Response response = given().when().get(counterPath); int code = response.statusCode();