Skip to content

Commit 04db2f0

Browse files
authored
Fix test flakiness for redisson (#7597)
1 parent f7ff143 commit 04db2f0

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

dd-java-agent/instrumentation/redisson/redisson-2.0.0/src/test/groovy/RedissonClientTest.groovy

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
21
import static datadog.trace.api.config.TraceInstrumentationConfig.DB_CLIENT_HOST_SPLIT_BY_INSTANCE
3-
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan
42

53
import com.redis.testcontainers.RedisContainer
64
import com.redis.testcontainers.RedisServer
@@ -54,17 +52,15 @@ abstract class RedissonClientTest extends VersionedNamingTestBase {
5452
}
5553

5654
def setup() {
57-
def cleanupSpan = runUnderTrace("cleanup") {
58-
activeSpan()
59-
}
60-
TEST_WRITER.waitUntilReported(cleanupSpan)
6155
TEST_WRITER.start()
6256
}
6357

6458
def cleanup() {
65-
RedisConnection conn = lowLevelRedisClient.connect()
66-
conn.sync(RedisCommands.FLUSHDB)
67-
conn.closeAsync().await()
59+
try (def suppressScope = TEST_TRACER.muteTracing()) {
60+
RedisConnection conn = lowLevelRedisClient.connect()
61+
conn.sync(RedisCommands.FLUSHDB)
62+
conn.closeAsync().await()
63+
}
6864
}
6965

7066
def "bucket set command"() {

dd-java-agent/instrumentation/redisson/redisson-2.3.0/src/test/groovy/RedissonClientTest.groovy

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,13 @@ abstract class RedissonClientTest extends VersionedNamingTestBase {
5353
}
5454

5555
def setup() {
56-
def cleanupSpan = runUnderTrace("cleanup") {
57-
activeSpan()
58-
}
59-
TEST_WRITER.waitUntilReported(cleanupSpan)
6056
TEST_WRITER.start()
6157
}
6258

6359
def cleanup() {
64-
redissonClient.getKeys().flushdb()
60+
try (def suppressScope = TEST_TRACER.muteTracing()) {
61+
redissonClient.getKeys().flushdb()
62+
}
6563
}
6664

6765
def "bucket set command"() {

dd-java-agent/instrumentation/redisson/redisson-3.10.3/src/test/groovy/RedissonClientTest.groovy

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,13 @@ abstract class RedissonClientTest extends VersionedNamingTestBase {
4747
}
4848

4949
def setup() {
50-
def cleanupSpan = runUnderTrace("cleanup") {
51-
activeSpan()
52-
}
53-
TEST_WRITER.waitUntilReported(cleanupSpan)
5450
TEST_WRITER.start()
5551
}
5652

5753
def cleanup() {
58-
redissonClient.getKeys().flushdb()
54+
try (def suppressScope = TEST_TRACER.muteTracing()) {
55+
redissonClient.getKeys().flushdb()
56+
}
5957
}
6058
def "bucket set command"() {
6159
when:

0 commit comments

Comments
 (0)