Fix flaky http client test (#10016)

This commit is contained in:
Lauri Tulmin 2023-12-06 13:57:00 +02:00 committed by GitHub
parent b637026bbb
commit afe10b551b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,7 @@
package io.opentelemetry.instrumentation.testing.junit.http;
import static io.opentelemetry.instrumentation.testing.util.TelemetryDataUtil.comparingRootSpanAttribute;
import static io.opentelemetry.instrumentation.testing.util.TelemetryDataUtil.orderByRootSpanName;
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
import static java.util.Arrays.asList;
@ -182,7 +183,8 @@ public abstract class AbstractHttpClientTest<REQUEST> implements HttpClientTypeA
assertThat(responseCode).isEqualTo(200);
testing.waitAndAssertTraces(
testing.waitAndAssertSortedTraces(
orderByRootSpanName("parent-client-span", "test-http-server"),
trace ->
trace.hasSpansSatisfyingExactly(
span -> span.hasName("parent-client-span").hasKind(SpanKind.CLIENT).hasNoParent()),