Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
db67d8e
Debug freezing test on CI.
AlexeyKuznetsov-DD Aug 11, 2025
b4d7fd6
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 12, 2025
025e232
Trying to reproduce.
AlexeyKuznetsov-DD Aug 12, 2025
b62fc03
Trying to reproduce.
AlexeyKuznetsov-DD Aug 12, 2025
d6d4454
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 13, 2025
835f313
Trying to reproduce.
AlexeyKuznetsov-DD Aug 13, 2025
5892ac5
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 13, 2025
7cafe75
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 14, 2025
01b34c3
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 14, 2025
a1fae6a
Updated flaky tests.
AlexeyKuznetsov-DD Aug 14, 2025
375a9ff
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 14, 2025
60deecd
Trying to reproduce.
AlexeyKuznetsov-DD Aug 14, 2025
0a415ca
Trying to reproduce.
AlexeyKuznetsov-DD Aug 14, 2025
4cfbfd7
Merge branch 'alexeyk/apache-http-5-flaky-tests' into alexeyk/debug-c…
AlexeyKuznetsov-DD Aug 14, 2025
7a263b9
Trying to reproduce.
AlexeyKuznetsov-DD Aug 14, 2025
fac9597
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 15, 2025
26d7a12
Trying to reproduce.
AlexeyKuznetsov-DD Aug 15, 2025
9179563
Trying to reproduce.
AlexeyKuznetsov-DD Aug 15, 2025
16cf188
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 18, 2025
435d111
Trying to reproduce.
AlexeyKuznetsov-DD Aug 18, 2025
fdb23a4
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 19, 2025
9232258
Trying to fix with `useStrictTraceWrites == false`
AlexeyKuznetsov-DD Aug 19, 2025
2c0c4ce
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 19, 2025
118a0ef
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 19, 2025
d6ce19f
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 20, 2025
ba2a706
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 21, 2025
6f7706b
Trying to reproduce.
AlexeyKuznetsov-DD Aug 21, 2025
b8f1dd3
Rolled back `useStrictTraceWrites == false`
AlexeyKuznetsov-DD Aug 21, 2025
4429e5d
Refactored dump logic: start thread in advance and sleep.
AlexeyKuznetsov-DD Aug 21, 2025
ce809d7
Trying to reproduce
AlexeyKuznetsov-DD Aug 21, 2025
79204d9
Refactored thread dump logic
AlexeyKuznetsov-DD Aug 22, 2025
d777c3c
Refactored thread dump logic
AlexeyKuznetsov-DD Aug 22, 2025
dd2ea8c
Trying to reproduce
AlexeyKuznetsov-DD Aug 22, 2025
b0de3f5
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 22, 2025
47459e1
Trying to reproduce.
AlexeyKuznetsov-DD Aug 23, 2025
2951394
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 23, 2025
1fc618f
Trying to reproduce.
AlexeyKuznetsov-DD Aug 23, 2025
497c6eb
Trying to reproduce with heap dump.
AlexeyKuznetsov-DD Aug 23, 2025
f1664c0
Skip non-gradle heap dumps
AlexeyKuznetsov-DD Aug 23, 2025
5cc4f48
Trying to reproduce.
AlexeyKuznetsov-DD Aug 23, 2025
bba600d
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 25, 2025
8c83c37
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 25, 2025
6f4b9a0
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Aug 25, 2025
551f427
Merged master. Trying to reproduce freeze on CI.
AlexeyKuznetsov-DD Aug 29, 2025
59a901a
Trying to reproduce freeze on CI.
AlexeyKuznetsov-DD Aug 29, 2025
2f3f36c
Trying to reproduce freeze on CI.
AlexeyKuznetsov-DD Aug 31, 2025
be4fc36
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Sep 2, 2025
8fdbbd2
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Sep 2, 2025
a5a12da
Trying to reproduce freeze on CI.
AlexeyKuznetsov-DD Sep 2, 2025
5d91afd
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Sep 3, 2025
1131478
Trying to reproduce freeze on CI.
AlexeyKuznetsov-DD Sep 3, 2025
87d887b
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Sep 4, 2025
b3f03e4
Attempt to catch freeze on CI
AlexeyKuznetsov-DD Sep 4, 2025
cbe64ad
Added guard for restClient shutdown freeze.
AlexeyKuznetsov-DD Sep 4, 2025
51fa67d
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Sep 4, 2025
3c7db63
Merge branch 'alexeyk/lettuce-freeze-fix' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Sep 4, 2025
ca4502f
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Sep 6, 2025
65d426f
Merge branch 'master' into alexeyk/debug-ci-freeze
AlexeyKuznetsov-DD Sep 8, 2025
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
1 change: 0 additions & 1 deletion dd-java-agent/instrumentation/lettuce-4/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

muzzle {
pass {
group = "biz.paluch.redis"
Expand Down
66 changes: 65 additions & 1 deletion gradle/configure_tests.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import java.time.Duration
import java.time.temporal.ChronoUnit
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit

def isTestingInstrumentation(Project project) {
return [
Expand Down Expand Up @@ -125,7 +127,7 @@ if (!project.property("activePartition")) {
}
}

tasks.withType(Test) {
tasks.withType(Test).configureEach {
// https://docs.gradle.com/develocity/flaky-test-detection/
// https://docs.gradle.com/develocity/gradle-plugin/current/#test_retry
develocity.testRetry {
Expand All @@ -134,3 +136,65 @@ tasks.withType(Test) {
}
}
}

tasks.withType(Test).configureEach {
doFirst {
// This manipulation is requred to move files into folder
// that will be collected by `collect_reports.sh` script.
String buildDir = layout.buildDirectory.asFile.get().absolutePath.replace("dd-trace-java/dd-java-agent",
"dd-trace-java/workspace/dd-java-agent")

def dupmsDir = new File(buildDir, "dumps")
dupmsDir.mkdirs()

// Scheduler to execute logic that will dump threads and heap
def scheduler = Executors.newSingleThreadScheduledExecutor({ r ->
Thread t = new Thread(r, "dump-scheduler")
t.setDaemon(true)
return t
})

// Schedule the dump job:
def future = scheduler.schedule({
try {
def threadDumpFile = new File(dupmsDir, "${System.currentTimeMillis()}-thread-dump.log")

new ProcessBuilder("jcmd", "0", "Thread.print", "-l")
.redirectErrorStream(true)
.redirectOutput(threadDumpFile)
.start().waitFor()

// Collect PIDs of all Java processes:
def jvmProcesses = "jcmd -l".execute().text.readLines()
jvmProcesses.each { p ->
// Process only test executors.
if (!p.contains("Gradle Test Executor")) {
return
}

def pid = p.substring(0, p.indexOf(' '))
def heapDumpFile = "${dupmsDir.absolutePath}/${System.currentTimeMillis()}-${pid}.hprof"
def cmd = "jcmd ${pid} GC.heap_dump ${heapDumpFile}"
cmd.execute().waitFor()
}
} catch (Throwable t) {
logger.warn("Dumping failed: ${t.message}", t)
} finally {
scheduler.shutdown()
}
}, 7, TimeUnit.MINUTES) // You can adjust this line with required delay.

// Store handles for cancellation in doLast:
ext.dumpFuture = future
ext.dumpScheduler = scheduler
}

doLast {
// Cancel if task completed faster than specified timeout.
try {
ext.dumpFuture?.cancel(false)
} finally {
ext.dumpScheduler?.shutdownNow()
}
}
}