Try cleaning more than once in test.
@@ -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) {
