Skip to content

Commit b3e5f84

Browse files
authored
Merge pull request #45989 from holly-cummins/otel-test-reset
Minor tidying of test to reduce line count and log chatter
2 parents 711452c + 0091db3 commit b3e5f84

File tree

1 file changed

+5
-9
lines changed
  • integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry

1 file changed

+5
-9
lines changed

integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry/MetricsTest.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ public class MetricsTest {
2626
@AfterEach
2727
void reset() {
2828
await().atMost(5, SECONDS).until(() -> {
29+
// make sure spans are cleared
2930
List<Map<String, Object>> spans = getSpans();
30-
if (spans.size() == 0) {
31-
return true;
32-
} else {
31+
if (!spans.isEmpty()) {
3332
given().get("/reset").then().statusCode(HTTP_OK);
34-
return false;
3533
}
34+
return spans.isEmpty();
3635
});
3736
}
3837

@@ -62,11 +61,8 @@ public void directCounterTest() {
6261
.then()
6362
.statusCode(200);
6463

65-
await().atMost(10, SECONDS).until(() -> {
66-
List<Map<String, Object>> spans = getSpans();
67-
System.out.println("spans size " + spans.size());
68-
return spans.size() == 2;
69-
});
64+
await().atMost(10, SECONDS).until(() -> getSpans().size() >= 2);
65+
assertEquals(2, getSpans().size(), () -> "The spans are " + getSpans());
7066
await().atMost(10, SECONDS).until(() -> getMetrics("direct-trace-counter").size() > 2);
7167

7268
List<Map<String, Object>> metrics = getMetrics("direct-trace-counter");

0 commit comments

Comments
 (0)