File tree Expand file tree Collapse file tree
dd-trace-ot/src/test/groovy/datadog/opentracing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import datadog.trace.agent.test.TestUtils
44import datadog.trace.common.writer.ListWriter
55import spock.lang.Specification
66import spock.lang.Subject
7+ import spock.lang.Timeout
78
89import java.lang.ref.WeakReference
910import java.util.concurrent.TimeUnit
@@ -94,6 +95,7 @@ class PendingTraceTest extends Specification {
9495 traceCount. get() == 1
9596 }
9697
98+ @Timeout (value = 60 , unit = TimeUnit .SECONDS )
9799 def " trace does not report when unfinished child discarded" () {
98100 when :
99101 def child = tracer. buildSpan(" child" ). asChildOf(rootSpan). start()
@@ -109,7 +111,8 @@ class PendingTraceTest extends Specification {
109111 def childRef = new WeakReference<> (child)
110112 child = null
111113 TestUtils . awaitGC(childRef)
112- while (trace. clean()) {
114+ while (trace. pendingReferenceCount. get() > 0 ) {
115+ trace. clean()
113116 }
114117
115118 then :
You can’t perform that action at this time.
0 commit comments