Skip to content

Commit

Permalink
Minor tidying of test to reduce line count and log chatter
Browse files Browse the repository at this point in the history
  • Loading branch information
holly-cummins committed Jan 30, 2025
1 parent b729259 commit 59de9b1
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ public class MetricsTest {
@AfterEach
void reset() {
await().atMost(5, SECONDS).until(() -> {
// make sure spans are cleared
List<Map<String, Object>> spans = getSpans();
if (spans.size() == 0) {
return true;
} else {
if (!spans.isEmpty()) {
given().get("/reset").then().statusCode(HTTP_OK);
return false;
}
return spans.isEmpty();
});
}

Expand Down Expand Up @@ -62,11 +61,8 @@ public void directCounterTest() {
.then()
.statusCode(200);

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

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

0 comments on commit 59de9b1

Please sign in to comment.