Skip to content

Commit 7ed6a98

Browse files
bm1549claude
andcommitted
Fix flaky check raw file injection test in LogInjectionSmokeTest
Three bugs contributed to flakiness in CI on JDK 8 variants (zulu8, semeru8) and under load: 1. Copy-paste bug in assertRawLogLinesWithInjection: the fallback assertion for 32-bit trace IDs incorrectly referenced logLines[0] (BEFORE FIRST SPAN) instead of logLines[4] (INSIDE THIRD SPAN) and logLines[6] (AFTER FORTH SPAN). This meant the 32-bit trace ID format was never actually validated for those two log lines. 2. BaseApplication.waitForCondition timeout was 10 seconds. On loaded CI machines with JDK 8 JVMs, the RC config change propagation through captureTraceConfig() could take several seconds, approaching the limit and causing "Logs injection config was never updated" failures. Increased to 30 seconds to give adequate headroom. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 828c9cc commit 7ed6a98

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

dd-smoke-tests/log-injection/src/main/java/datadog/smoketest/loginjection/BaseApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import java.util.function.Supplier;
1111

1212
public abstract class BaseApplication {
13-
public static final long TIMEOUT_IN_NANOS = TimeUnit.SECONDS.toNanos(10);
13+
public static final long TIMEOUT_IN_NANOS = TimeUnit.SECONDS.toNanos(30);
1414

1515
public abstract void doLog(String message);
1616

dd-smoke-tests/log-injection/src/test/groovy/datadog/smoketest/LogInjectionSmokeTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ abstract class LogInjectionSmokeTest extends AbstractSmokeTest {
231231
assert logLines[1].endsWith("- ${tagsPart} ${firstTraceId} ${firstSpanId} - INSIDE FIRST SPAN")
232232
assert logLines[2].endsWith("- ${tagsPart} - AFTER FIRST SPAN") || logLines[2].endsWith("- ${tagsPart} 0 0 - AFTER FIRST SPAN")
233233
assert logLines[3].endsWith("- ${tagsPart} ${secondTraceId} ${secondSpanId} - INSIDE SECOND SPAN")
234-
assert logLines[4].endsWith("- - INSIDE THIRD SPAN") || logLines[0].endsWith("- 0 0 - INSIDE THIRD SPAN")
234+
assert logLines[4].endsWith("- - INSIDE THIRD SPAN") || logLines[4].endsWith("- 0 0 - INSIDE THIRD SPAN")
235235
assert logLines[5].endsWith("- ${tagsPart} ${forthTraceId} ${forthSpanId} - INSIDE FORTH SPAN")
236-
assert logLines[6].endsWith("- ${tagsPart} - AFTER FORTH SPAN") || logLines[0].endsWith("- ${tagsPart} 0 0 - AFTER FORTH SPAN")
236+
assert logLines[6].endsWith("- ${tagsPart} - AFTER FORTH SPAN") || logLines[6].endsWith("- ${tagsPart} 0 0 - AFTER FORTH SPAN")
237237
return true
238238
}
239239

0 commit comments

Comments
 (0)