Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test flakiness for redisson #7597

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down