diff --git a/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryReactiveTest.java b/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryReactiveTest.java index 757e4455e200e0..6ec053fa440cc7 100644 --- a/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryReactiveTest.java +++ b/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryReactiveTest.java @@ -22,6 +22,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; +import java.time.Duration; import java.util.List; import java.util.Map; import java.util.Optional; @@ -41,8 +42,14 @@ public class OpenTelemetryReactiveTest { @BeforeEach @AfterEach void reset() { - given().get("/reset").then().statusCode(HTTP_OK); - await().atMost(5, SECONDS).until(() -> getSpans().size() == 0); + await().atMost(Duration.ofSeconds(30L)).until(() -> { + // make sure spans are cleared + List<Map<String, Object>> spans = getSpans(); + if (!spans.isEmpty()) { + given().get("/reset").then().statusCode(HTTP_OK); + } + return spans.isEmpty(); + }); } @Test diff --git a/integration-tests/opentelemetry-spi/src/test/java/io/quarkus/it/opentelemetry/spi/OTelSpiTest.java b/integration-tests/opentelemetry-spi/src/test/java/io/quarkus/it/opentelemetry/spi/OTelSpiTest.java index 94e7cb3fd64284..86f6c3265a05ee 100644 --- a/integration-tests/opentelemetry-spi/src/test/java/io/quarkus/it/opentelemetry/spi/OTelSpiTest.java +++ b/integration-tests/opentelemetry-spi/src/test/java/io/quarkus/it/opentelemetry/spi/OTelSpiTest.java @@ -33,8 +33,14 @@ public class OTelSpiTest { @BeforeEach @AfterEach void reset() { - given().get("/reset").then().statusCode(HTTP_OK); - await().atMost(5, SECONDS).until(() -> getSpans().size() == 0); + await().atMost(Duration.ofSeconds(30L)).until(() -> { + // make sure spans are cleared + List<Map<String, Object>> spans = getSpans(); + if (!spans.isEmpty()) { + given().get("/reset").then().statusCode(HTTP_OK); + } + return spans.isEmpty(); + }); } private List<Map<String, Object>> getSpans() { diff --git a/integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry/OpenTelemetryInjectionsTest.java b/integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry/OpenTelemetryInjectionsTest.java index 9430bd7583a3c2..b945bbddf22ef4 100644 --- a/integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry/OpenTelemetryInjectionsTest.java +++ b/integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry/OpenTelemetryInjectionsTest.java @@ -6,6 +6,7 @@ import static java.util.concurrent.TimeUnit.SECONDS; import static org.awaitility.Awaitility.await; +import java.time.Duration; import java.util.List; import java.util.Map; @@ -22,8 +23,14 @@ public class OpenTelemetryInjectionsTest { @BeforeEach @AfterEach void reset() { - given().get("/reset").then().statusCode(HTTP_OK); - await().atMost(5, SECONDS).until(() -> getSpans().size() == 0); + await().atMost(Duration.ofSeconds(30L)).until(() -> { + // make sure spans are cleared + List<Map<String, Object>> spans = getSpans(); + if (!spans.isEmpty()) { + given().get("/reset").then().statusCode(HTTP_OK); + } + return spans.isEmpty(); + }); } private List<Map<String, Object>> getSpans() {