Try cleaning more than once in test.
MODIFY
dd-trace-ot/src/test/groovy/datadog/opentracing/scopemanager/ScopeManagerTest.groovy
dd-trace-ot/src/test/groovy/datadog/opentracing/scopemanager/ScopeManagerTest.groovy
@@ -195,8 +195,9 @@ class ScopeManagerTest extends Specification {
when:
if (forceGC) {
continuation = null // Continuation references also hold up traces.
+ while (!((DDSpanContext) span.context()).trace.clean()) {
PendingTrace.awaitGC()
- ((DDSpanContext) span.context()).trace.clean()
+ }
writer.waitForTraces(1)
}
if (autoClose) {

Try cleaning more than once in test.