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 757e4455e200e..6ec053fa440cc 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> 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 94e7cb3fd6428..8148595632a0f 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 @@ -4,7 +4,6 @@ import static io.restassured.RestAssured.get; import static io.restassured.RestAssured.given; import static java.net.HttpURLConnection.HTTP_OK; -import static java.util.concurrent.TimeUnit.SECONDS; import static org.awaitility.Awaitility.await; import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.jupiter.api.Assertions.*; @@ -33,8 +32,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> spans = getSpans(); + if (!spans.isEmpty()) { + given().get("/reset").then().statusCode(HTTP_OK); + } + return spans.isEmpty(); + }); } private List> 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 9430bd7583a3c..b945bbddf22ef 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> spans = getSpans(); + if (!spans.isEmpty()) { + given().get("/reset").then().statusCode(HTTP_OK); + } + return spans.isEmpty(); + }); } private List> getSpans() {