Skip to content

Commit 9a35dac

Browse files
authored
Fix couchbase flaky test (cleanup phase) (#7598)
Mute tracing on cleanup, instead of waiting for a cleanup span. This test is flaky when it does not receive the cleanup span in time (under heavy load). Also, do not shallow exceptions on cleanup. If we ever get them, we can address them, or add a more specific catch.
1 parent 04db2f0 commit 9a35dac

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

dd-java-agent/instrumentation/couchbase/couchbase-2.0/src/test/groovy/util/AbstractCouchbaseTest.groovy

+4-12
Original file line numberDiff line numberDiff line change
@@ -114,25 +114,17 @@ abstract class AbstractCouchbaseTest extends VersionedNamingTestBase {
114114
}
115115

116116
protected void cleanupCluster(CouchbaseAsyncCluster cluster, CouchbaseEnvironment environment) {
117-
def cleanupSpan = runUnderTrace("cleanup") {
118-
try {
119-
cluster?.disconnect()?.timeout(10, TimeUnit.SECONDS)?.toBlocking()?.single()
120-
environment.shutdown()
121-
} catch (Throwable ex) {
122-
// ignore
123-
}
124-
activeSpan()
117+
try (def suppressScope = TEST_TRACER.muteTracing()) {
118+
cluster?.disconnect()?.timeout(10, TimeUnit.SECONDS)?.toBlocking()?.single()
119+
environment.shutdown()
125120
}
126-
TEST_WRITER.waitUntilReported(cleanupSpan as DDSpan, 60, TimeUnit.SECONDS)
127121
}
128122

129123
protected void cleanupCluster(CouchbaseCluster cluster, CouchbaseEnvironment environment) {
130-
def cleanupSpan = runUnderTrace("cleanup") {
124+
try (def suppressScope = TEST_TRACER.muteTracing()) {
131125
cluster?.disconnect()
132126
environment.shutdown()
133-
activeSpan()
134127
}
135-
TEST_WRITER.waitUntilReported(cleanupSpan as DDSpan)
136128
}
137129

138130
void assertCouchbaseCall(TraceAssert trace, String name, String bucketName = null, Object parentSpan = null) {

0 commit comments

Comments
 (0)