Skip to content

Commit b859485

Browse files
authored
Fix flaky camel test (#1964)
1 parent 1671951 commit b859485

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

instrumentation/apache-camel-2.20/javaagent/src/test/groovy/test/MulticastDirectCamelTest.groovy

+9-6
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,23 @@ class MulticastDirectCamelTest extends AgentTestRunner {
5151
"apache-camel.uri" "direct://input"
5252
}
5353
}
54-
it.span(1) {
55-
name "second"
54+
// there is no strict ordering of "first" and "second" span
55+
def indexOfFirst = span(1).name == "first" ? 1 : 2
56+
def indexOfSecond = span(1).name == "second" ? 1 : 2
57+
it.span(indexOfFirst) {
58+
name "first"
5659
kind INTERNAL
5760
parentSpanId parent.span(0).spanId
5861
attributes {
59-
"apache-camel.uri" "direct://second"
62+
"apache-camel.uri" "direct://first"
6063
}
6164
}
62-
it.span(2) {
63-
name "first"
65+
it.span(indexOfSecond) {
66+
name "second"
6467
kind INTERNAL
6568
parentSpanId parent.span(0).spanId
6669
attributes {
67-
"apache-camel.uri" "direct://first"
70+
"apache-camel.uri" "direct://second"
6871
}
6972
}
7073
}

0 commit comments

Comments
 (0)