Skip to content

Commit 0f7334f

Browse files
committed
fix thread name matching
1 parent 8dfe6f4 commit 0f7334f

2 files changed

Lines changed: 13 additions & 15 deletions

File tree

dd-smoke-tests/debugger-integration-tests/src/main/java/datadog/smoketest/debugger/TestApplicationHelper.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313

1414
public class TestApplicationHelper {
1515
// instrumentation is done by main thread
16-
private static final String INSTRUMENTATION_DONE_MAIN_THREAD =
17-
"[main] DEBUG com.datadog.debugger.agent.DebuggerTransformer - Generating bytecode for class: %s";
18-
private static final String INSTRUMENTATION_DONE_BCKG_THREAD =
19-
"[dd-remote-config] DEBUG com.datadog.debugger.agent.DebuggerTransformer - Generating bytecode for class: %s";
20-
private static final String INSTRUMENTATION_DONE_TASK_THREAD =
21-
"[dd-task-scheduler] DEBUG com.datadog.debugger.agent.DebuggerTransformer - Generating bytecode for class: %s";
16+
private static final String INSTRUMENTATION_DONE =
17+
"[%s] DEBUG com.datadog.debugger.agent.DebuggerTransformer - Generating bytecode for class: %s";
18+
private static final String THREAD_MAIN = "main";
19+
private static final String THREAD_REMOTE_CONFIG = "dd-remote-config";
20+
private static final String THREAD_SCHEDULER = "dd-task-scheduler";
21+
private static final String THREAD_STARTUP = "dd-agent-startup-datadog-tracer";
22+
private static final String[] THREAD_NAMES =
23+
new String[] {THREAD_MAIN, THREAD_REMOTE_CONFIG, THREAD_SCHEDULER, THREAD_STARTUP};
2224
private static final String RENTRANSFORMATION_CLASS =
2325
"[dd-remote-config] DEBUG com.datadog.debugger.agent.ConfigurationUpdater - Re-transforming class: %s";
2426
private static final String RETRANSFORMATION_DONE =
@@ -52,17 +54,16 @@ public static String waitForInstrumentation(String logFileName, String className
5254
fromLine != null ? line -> line.contains(fromLine) : null,
5355
line -> {
5456
// when instrumentation is done by main thread, we are good to go
55-
if (line.contains(String.format(INSTRUMENTATION_DONE_MAIN_THREAD, className))) {
57+
if (line.contains(String.format(INSTRUMENTATION_DONE, THREAD_MAIN, className))) {
5658
return true;
5759
}
5860
if (!generatingByteCode.get()) {
5961
// instrumentation is done by background thread, need to wait for end of
6062
// re-transformation
61-
if (line.contains(String.format(INSTRUMENTATION_DONE_BCKG_THREAD, className))) {
62-
generatingByteCode.set(true);
63-
}
64-
if (line.contains(String.format(INSTRUMENTATION_DONE_TASK_THREAD, className))) {
65-
generatingByteCode.set(true);
63+
for (String threadName : THREAD_NAMES) {
64+
if (line.contains(String.format(INSTRUMENTATION_DONE, threadName, className))) {
65+
generatingByteCode.set(true);
66+
}
6667
}
6768
} else {
6869
return line.contains(RETRANSFORMATION_DONE);

dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/TracerDebuggerIntegrationTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ void testTracer(boolean processTagsEnabled) throws Exception {
5454
PROBE_ID.getId(), intakeRequest.getDebugger().getSnapshot().getProbe().getId());
5555
assertTrue(Pattern.matches("[0-9a-f]+", intakeRequest.getTraceId()));
5656
assertTrue(Pattern.matches("\\d+", intakeRequest.getSpanId()));
57-
assertFalse(
58-
logHasErrors(
59-
logFilePath, it -> it.contains("TypePool$Resolution$NoSuchTypeException")));
6057
if (processTagsEnabled) {
6158
assertNotNull(intakeRequest.getProcessTags());
6259
assertTrue(

0 commit comments

Comments
 (0)