From c9ca2e19bbc535f0d45de51b0d8d29cd2bf732d6 Mon Sep 17 00:00:00 2001 From: Andrea Marziali Date: Tue, 10 Sep 2024 16:30:53 +0200 Subject: [PATCH] Fix test flakiness for redisson --- .../src/test/groovy/RedissonClientTest.groovy | 14 +++++--------- .../src/test/groovy/RedissonClientTest.groovy | 8 +++----- .../src/test/groovy/RedissonClientTest.groovy | 8 +++----- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/dd-java-agent/instrumentation/redisson/redisson-2.0.0/src/test/groovy/RedissonClientTest.groovy b/dd-java-agent/instrumentation/redisson/redisson-2.0.0/src/test/groovy/RedissonClientTest.groovy index 241ebb20470..abf5d5bb63f 100644 --- a/dd-java-agent/instrumentation/redisson/redisson-2.0.0/src/test/groovy/RedissonClientTest.groovy +++ b/dd-java-agent/instrumentation/redisson/redisson-2.0.0/src/test/groovy/RedissonClientTest.groovy @@ -1,6 +1,4 @@ -import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace import static datadog.trace.api.config.TraceInstrumentationConfig.DB_CLIENT_HOST_SPLIT_BY_INSTANCE -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan import com.redis.testcontainers.RedisContainer import com.redis.testcontainers.RedisServer @@ -54,17 +52,15 @@ abstract class RedissonClientTest extends VersionedNamingTestBase { } def setup() { - def cleanupSpan = runUnderTrace("cleanup") { - activeSpan() - } - TEST_WRITER.waitUntilReported(cleanupSpan) TEST_WRITER.start() } def cleanup() { - RedisConnection conn = lowLevelRedisClient.connect() - conn.sync(RedisCommands.FLUSHDB) - conn.closeAsync().await() + try (def suppressScope = TEST_TRACER.muteTracing()) { + RedisConnection conn = lowLevelRedisClient.connect() + conn.sync(RedisCommands.FLUSHDB) + conn.closeAsync().await() + } } def "bucket set command"() { diff --git a/dd-java-agent/instrumentation/redisson/redisson-2.3.0/src/test/groovy/RedissonClientTest.groovy b/dd-java-agent/instrumentation/redisson/redisson-2.3.0/src/test/groovy/RedissonClientTest.groovy index af6d95284c4..2345f6de2cd 100644 --- a/dd-java-agent/instrumentation/redisson/redisson-2.3.0/src/test/groovy/RedissonClientTest.groovy +++ b/dd-java-agent/instrumentation/redisson/redisson-2.3.0/src/test/groovy/RedissonClientTest.groovy @@ -53,15 +53,13 @@ abstract class RedissonClientTest extends VersionedNamingTestBase { } def setup() { - def cleanupSpan = runUnderTrace("cleanup") { - activeSpan() - } - TEST_WRITER.waitUntilReported(cleanupSpan) TEST_WRITER.start() } def cleanup() { - redissonClient.getKeys().flushdb() + try (def suppressScope = TEST_TRACER.muteTracing()) { + redissonClient.getKeys().flushdb() + } } def "bucket set command"() { diff --git a/dd-java-agent/instrumentation/redisson/redisson-3.10.3/src/test/groovy/RedissonClientTest.groovy b/dd-java-agent/instrumentation/redisson/redisson-3.10.3/src/test/groovy/RedissonClientTest.groovy index 588a2c3bfa1..e215da16ffb 100644 --- a/dd-java-agent/instrumentation/redisson/redisson-3.10.3/src/test/groovy/RedissonClientTest.groovy +++ b/dd-java-agent/instrumentation/redisson/redisson-3.10.3/src/test/groovy/RedissonClientTest.groovy @@ -47,15 +47,13 @@ abstract class RedissonClientTest extends VersionedNamingTestBase { } def setup() { - def cleanupSpan = runUnderTrace("cleanup") { - activeSpan() - } - TEST_WRITER.waitUntilReported(cleanupSpan) TEST_WRITER.start() } def cleanup() { - redissonClient.getKeys().flushdb() + try (def suppressScope = TEST_TRACER.muteTracing()) { + redissonClient.getKeys().flushdb() + } } def "bucket set command"() { when: