Remove baggage item test
The new agent api does not have baggage item support.
This commit is contained in:
parent
a9d3360701
commit
99ddc497e7
|
@ -1,21 +1,12 @@
|
||||||
import datadog.trace.agent.test.AgentTestRunner
|
import datadog.trace.agent.test.AgentTestRunner
|
||||||
import datadog.trace.agent.test.utils.OkHttpUtils
|
import datadog.trace.agent.test.utils.OkHttpUtils
|
||||||
import datadog.trace.api.DDSpanTypes
|
import datadog.trace.api.DDSpanTypes
|
||||||
import datadog.trace.api.DDTags
|
|
||||||
import datadog.trace.context.TraceScope
|
|
||||||
import io.opentracing.Scope
|
|
||||||
import io.opentracing.tag.Tags
|
import io.opentracing.tag.Tags
|
||||||
import io.opentracing.util.GlobalTracer
|
|
||||||
import okhttp3.HttpUrl
|
import okhttp3.HttpUrl
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import ratpack.exec.Promise
|
|
||||||
import ratpack.exec.util.ParallelBatch
|
|
||||||
import ratpack.groovy.test.embed.GroovyEmbeddedApp
|
import ratpack.groovy.test.embed.GroovyEmbeddedApp
|
||||||
import ratpack.path.PathBinding
|
import ratpack.path.PathBinding
|
||||||
import ratpack.test.exec.ExecHarness
|
|
||||||
|
|
||||||
import java.util.concurrent.CountDownLatch
|
|
||||||
|
|
||||||
class RatpackOtherTest extends AgentTestRunner {
|
class RatpackOtherTest extends AgentTestRunner {
|
||||||
|
|
||||||
|
@ -125,51 +116,4 @@ class RatpackOtherTest extends AgentTestRunner {
|
||||||
"e/foo" | "e/:val?:\\d+"
|
"e/foo" | "e/:val?:\\d+"
|
||||||
"f/123" | "f/:val:\\d+"
|
"f/123" | "f/:val:\\d+"
|
||||||
}
|
}
|
||||||
|
|
||||||
def "forked executions inherit parent scope"() {
|
|
||||||
when:
|
|
||||||
def result = ExecHarness.yieldSingle({}, {
|
|
||||||
final Scope scope =
|
|
||||||
GlobalTracer.get()
|
|
||||||
.buildSpan("ratpack.exec-test")
|
|
||||||
.withTag(DDTags.RESOURCE_NAME, "INSIDE-TEST")
|
|
||||||
.startActive(true)
|
|
||||||
|
|
||||||
((TraceScope) scope).setAsyncPropagation(true)
|
|
||||||
scope.span().setBaggageItem("test-baggage", "foo")
|
|
||||||
ParallelBatch.of(testPromise(), testPromise())
|
|
||||||
.yield()
|
|
||||||
.map({ now ->
|
|
||||||
// close the scope now that we got the baggage inside the promises
|
|
||||||
scope.close()
|
|
||||||
return now
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
then:
|
|
||||||
result.valueOrThrow == ["foo", "foo"]
|
|
||||||
assertTraces(1) {
|
|
||||||
trace(0, 1) {
|
|
||||||
span(0) {
|
|
||||||
resourceName "INSIDE-TEST"
|
|
||||||
serviceName "unnamed-java-app"
|
|
||||||
operationName "ratpack.exec-test"
|
|
||||||
parent()
|
|
||||||
errored false
|
|
||||||
tags {
|
|
||||||
defaultTags()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// returns a promise that contains the active scope's "test-baggage" baggage
|
|
||||||
Promise<String> testPromise(CountDownLatch latch = null) {
|
|
||||||
Promise.sync {
|
|
||||||
latch?.await()
|
|
||||||
Scope tracerScope = GlobalTracer.get().scopeManager().active()
|
|
||||||
return tracerScope?.span()?.getBaggageItem("test-baggage")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue