Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
marychatte committed Aug 5, 2024
1 parent 7a1cb3d commit 830b2ee
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpClientTes
import io.opentelemetry.instrumentation.testing.junit.http.HttpClientResult
import io.opentelemetry.instrumentation.testing.junit.http.HttpClientTestOptions
import io.opentelemetry.instrumentation.testing.junit.http.HttpClientTestOptions.DEFAULT_HTTP_ATTRIBUTES
import io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions
import io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat
import io.opentelemetry.sdk.testing.assertj.TraceAssert
import io.opentelemetry.semconv.NetworkAttributes
import kotlinx.coroutines.*
Expand Down Expand Up @@ -85,13 +85,13 @@ abstract class AbstractKtorHttpClientTest : AbstractHttpClientTest<HttpRequestBu
val uri = resolveAddress(path)
val responseCode = doRequest(method, uri)

Assertions.assertThat(responseCode).isEqualTo(200)
assertThat(responseCode).isEqualTo(200)

testing.waitAndAssertTraces(
Consumer { trace: TraceAssert ->
val span = trace.getSpan(0)
OpenTelemetryAssertions.assertThat(span).hasKind(SpanKind.CLIENT)
Assertions.assertThat(span.endEpochNanos - span.startEpochNanos >= 1000000)
assertThat(span).hasKind(SpanKind.CLIENT)
assertThat(span.endEpochNanos - span.startEpochNanos >= 1_000_000_000)
.describedAs("Span duration should be at least 1000ms")
.isTrue()
}
Expand Down

0 comments on commit 830b2ee

Please sign in to comment.