Fix flaky spring rabbit test (#8631)

This commit is contained in:
Lauri Tulmin 2023-06-01 18:23:21 +03:00 committed by GitHub
parent 0840ed86a7
commit 0ea2d7b8d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -91,7 +91,12 @@ class ContextPropagationTest extends AgentInstrumentationSpecification {
then:
assertTraces(2) {
trace(0, 5) {
spans.subList(2, 4).sort {
spans.subList(2, 5).sort {
// sort "consumer" span after "testQueue process" spans
if (it.name == "consumer") {
return 2
}
// order "testQueue process" spans
def destination = it.attributes.get(SemanticAttributes.MESSAGING_DESTINATION_NAME)
return destination == "<default>" ? 0 : 1
}