Skip to content

Commit

Permalink
Fix flakyness of universal profiling integration bufferCapacityExceed…
Browse files Browse the repository at this point in the history
…ed test (#245)
  • Loading branch information
JonasKunz authored May 7, 2024
1 parent ea13189 commit 76ccb1c
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,15 +546,23 @@ void bufferCapacityExceeded() {

Span span1 = tracer.spanBuilder("span1").startSpan();
span1.end();

// This call is required to avoid flakyness of the test
// span1 will be picked up by the PeekingPooler, therefore the queue is now empty again
processor.pollMessagesAndFlushPendingSpans();

Span span2 = tracer.spanBuilder("span2").startSpan();
span2.end();
// now the buffer should be full, span 3 should be sent immediately
Span span3 = tracer.spanBuilder("span3").startSpan();
span3.end();

// now the buffer should be full, span 4 should be sent immediately
Span span4 = tracer.spanBuilder("span4").startSpan();
span4.end();

assertThat(spans.getFinishedSpanItems())
.hasSize(1)
.anySatisfy(sp -> assertThat(sp).hasName("span3"));
.anySatisfy(sp -> assertThat(sp).hasName("span4"));
}
}

Expand Down

0 comments on commit 76ccb1c

Please sign in to comment.