Skip to content

Commit 4c6ba5b

Browse files
opentelemetrybotlaurit
andauthoredMar 21, 2024··
[release/v1.33.x] Fix flaky http client test (#10914)
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
1 parent ac0436d commit 4c6ba5b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/http/AbstractHttpClientTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import static io.opentelemetry.api.common.AttributeKey.stringKey;
99
import static io.opentelemetry.instrumentation.testing.util.TelemetryDataUtil.comparingRootSpanAttribute;
10+
import static io.opentelemetry.instrumentation.testing.util.TelemetryDataUtil.orderByRootSpanName;
1011
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
1112
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
1213
import static io.opentelemetry.semconv.SemanticAttributes.NetTransportValues.IP_TCP;
@@ -185,7 +186,8 @@ void shouldSuppressNestedClientSpanIfAlreadyUnderParentClientSpan(String method)
185186

186187
assertThat(responseCode).isEqualTo(200);
187188

188-
testing.waitAndAssertTraces(
189+
testing.waitAndAssertSortedTraces(
190+
orderByRootSpanName("parent-client-span", "test-http-server"),
189191
trace ->
190192
trace.hasSpansSatisfyingExactly(
191193
span -> span.hasName("parent-client-span").hasKind(SpanKind.CLIENT).hasNoParent()),

0 commit comments

Comments
 (0)
Please sign in to comment.