File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff 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" );
You can’t perform that action at this time.
0 commit comments