Skip to content

Commit f0e6c82

Browse files
committed
Update PekkoHttpTestAsyncWebServer.scala
1 parent c941a32 commit f0e6c82

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

instrumentation/pekko/pekko-http-1.0/javaagent/src/test/scala/io/opentelemetry/javaagent/instrumentation/pekkohttp/v1_0/PekkoHttpTestAsyncWebServer.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
package io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0
77

8-
import io.opentelemetry.context.Context
8+
import io.opentelemetry.api.trace.Span
99
import io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint._
1010
import io.opentelemetry.instrumentation.testing.junit.http.{AbstractHttpServerTest, ServerEndpoint}
1111
import org.apache.pekko.actor.ActorSystem
@@ -63,10 +63,10 @@ object PekkoHttpTestAsyncWebServer {
6363
AbstractHttpServerTest.controller(endpoint, () =>
6464
for {
6565
_ <- Future.successful(2)
66-
firstContext = Context.current()
66+
firstTraceId = Span.current().getSpanContext().getTraceId()
6767
_ <- after(1.second, system.scheduler)(Future.successful(1))
68-
secondContext = Context.current()
69-
_ = assert(firstContext eq secondContext)
68+
secondTraceId = Span.current().getSpanContext().getTraceId()
69+
_ = require(firstTraceId eq secondTraceId, s"TraceId $firstTraceId did not match $secondTraceId")
7070
} yield HttpResponse(status = OK, entity = endpoint.getBody)
7171
)
7272
}

0 commit comments

Comments
 (0)