From b859485cd0981cdf1ddbba8503364f7755ee6e1a Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Tue, 5 Jan 2021 14:16:52 -0800 Subject: [PATCH] Fix flaky camel test (#1964) --- .../groovy/test/MulticastDirectCamelTest.groovy | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/instrumentation/apache-camel-2.20/javaagent/src/test/groovy/test/MulticastDirectCamelTest.groovy b/instrumentation/apache-camel-2.20/javaagent/src/test/groovy/test/MulticastDirectCamelTest.groovy index bcf5309e3c38..8b3b84ebfe23 100644 --- a/instrumentation/apache-camel-2.20/javaagent/src/test/groovy/test/MulticastDirectCamelTest.groovy +++ b/instrumentation/apache-camel-2.20/javaagent/src/test/groovy/test/MulticastDirectCamelTest.groovy @@ -51,20 +51,23 @@ class MulticastDirectCamelTest extends AgentTestRunner { "apache-camel.uri" "direct://input" } } - it.span(1) { - name "second" + // there is no strict ordering of "first" and "second" span + def indexOfFirst = span(1).name == "first" ? 1 : 2 + def indexOfSecond = span(1).name == "second" ? 1 : 2 + it.span(indexOfFirst) { + name "first" kind INTERNAL parentSpanId parent.span(0).spanId attributes { - "apache-camel.uri" "direct://second" + "apache-camel.uri" "direct://first" } } - it.span(2) { - name "first" + it.span(indexOfSecond) { + name "second" kind INTERNAL parentSpanId parent.span(0).spanId attributes { - "apache-camel.uri" "direct://first" + "apache-camel.uri" "direct://second" } } }