Skip to content

Commit 9e8a13e

Browse files
Attempt to specify full path
1 parent 3b1a643 commit 9e8a13e

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

dd-java-agent/instrumentation/java-concurrent/java-concurrent-21/src/previewTest/groovy/StructuredConcurrencyTest.groovy

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ class StructuredConcurrencyTest extends AgentTestRunner {
2121

2222
threadDumpTask = scheduler.scheduleAtFixedRate({
2323
File reportDir = new File("build")
24-
println("DEBUG: " + reportDir.absolutePath)
24+
String fullPath = reportDir.absolutePath.replace("dd-trace-java/dd-java-agent",
25+
"dd-trace-java/workspace/dd-java-agent")
2526

2627
if (!reportDir.exists()) {
27-
println("build folder not found")
28+
println("Folder not found: " + fullPath)
2829
return
2930
}
3031

3132
// Define the file path
32-
File reportFile = new File(reportDir, String.format("thread-dump-%d.log", System.currentTimeMillis()))
33+
File reportFile = new File(fullPath, String.format("thread-dump-%d.log", System.currentTimeMillis()))
3334

3435
// Write to the file
3536
try (FileWriter writer = new FileWriter(reportFile)) {

dd-java-agent/instrumentation/lettuce-4/src/test/groovy/Lettuce4ClientTestBase.groovy

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,20 @@ abstract class Lettuce4ClientTestBase extends VersionedNamingTestBase {
7373

7474
threadDumpTask = scheduler.scheduleAtFixedRate({
7575
File reportDir = new File("build")
76-
println("DEBUG: " + reportDir.absolutePath)
76+
String fullPath = reportDir.absolutePath.replace("dd-trace-java/dd-java-agent",
77+
"dd-trace-java/workspace/dd-java-agent")
7778

7879
if (!reportDir.exists()) {
79-
println("build folder not found")
80+
println("Folder not found: " + fullPath)
8081
return
8182
}
8283

8384
// Define the file path
84-
File reportFile = new File(reportDir, String.format("thread-dump-%d.log", System.currentTimeMillis()))
85+
File reportFile = new File(fullPath, String.format("thread-dump-%d.log", System.currentTimeMillis()))
8586

8687
// Write to the file
8788
try (FileWriter writer = new FileWriter(reportFile)) {
89+
println()
8890
def s = "=== Thread Dump Triggered at ${new Date()} ===\n"
8991
println(s)
9092
writer.write(s)

0 commit comments

Comments
 (0)