Skip to content

Commit

Permalink
Fix couchbase flaky test (cleanup phase)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
smola committed Sep 10, 2024
1 parent 04db2f0 commit a049705
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,25 +114,17 @@ abstract class AbstractCouchbaseTest extends VersionedNamingTestBase {
}

protected void cleanupCluster(CouchbaseAsyncCluster cluster, CouchbaseEnvironment environment) {
def cleanupSpan = runUnderTrace("cleanup") {
try {
cluster?.disconnect()?.timeout(10, TimeUnit.SECONDS)?.toBlocking()?.single()
environment.shutdown()
} catch (Throwable ex) {
// ignore
}
activeSpan()
try (def suppressScope = TEST_TRACER.muteTracing()) {
cluster?.disconnect()?.timeout(10, TimeUnit.SECONDS)?.toBlocking()?.single()
environment.shutdown()
}
TEST_WRITER.waitUntilReported(cleanupSpan as DDSpan, 60, TimeUnit.SECONDS)
}

protected void cleanupCluster(CouchbaseCluster cluster, CouchbaseEnvironment environment) {
def cleanupSpan = runUnderTrace("cleanup") {
try (def suppressScope = TEST_TRACER.muteTracing()) {
cluster?.disconnect()
environment.shutdown()
activeSpan()
}
TEST_WRITER.waitUntilReported(cleanupSpan as DDSpan)
}

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

0 comments on commit a049705

Please sign in to comment.