Skip to content

Commit 52b943d

Browse files
authored
Fix flaky InProduct enablement smoke test (#8627)
Wait for feature started before sending request to avoid racy startup
1 parent 4a5461c commit 52b943d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/DebuggerAgent.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ public static void startDynamicInstrumentation() {
172172
} else {
173173
LOGGER.debug("No configuration poller available from SharedCommunicationObjects");
174174
}
175+
LOGGER.info("Started Dynamic Instrumentation");
175176
}
176177

177178
public static void stopDynamicInstrumentation() {
@@ -205,6 +206,7 @@ public static void startExceptionReplay() {
205206
Duration.ofSeconds(config.getDebuggerExceptionCaptureInterval()),
206207
config.getDebuggerMaxExceptionPerSecond());
207208
DebuggerContext.initExceptionDebugger(exceptionDebugger);
209+
LOGGER.info("Started Exception Replay");
208210
}
209211

210212
public static void stopExceptionReplay() {
@@ -230,6 +232,7 @@ public static void startCodeOriginForSpans() {
230232
initClassNameFilter();
231233
DebuggerContext.initClassNameFilter(classNameFilter);
232234
DebuggerContext.initCodeOrigin(new DefaultCodeOriginRecorder(config, configurationUpdater));
235+
LOGGER.info("Started Code Origin for spans");
233236
}
234237

235238
public static void stopCodeOriginForSpans() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected void stop() {
7676
}
7777

7878
protected void waitForInstrumentation(String className) {
79-
System.out.println("waitForInstrumentation on " + className + " from: " + lastMatchedLine);
79+
System.out.println("waitForInstrumentation on " + className);
8080
try {
8181
lastMatchedLine =
8282
TestApplicationHelper.waitForInstrumentation(LOG_FILENAME, className, lastMatchedLine);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import static datadog.smoketest.debugger.TestApplicationHelper.waitForSpecificLine;
44

55
import com.datadog.debugger.probe.LogProbe;
6-
import datadog.trace.test.util.Flaky;
76
import java.io.IOException;
87
import java.nio.file.Path;
98
import java.util.ArrayList;
@@ -53,7 +52,6 @@ void testDynamicInstrumentationEnablementStaticallyDisabled() throws Exception {
5352
waitForSpecificLine(appUrl, "Feature dynamic.instrumentation.enabled is explicitly disabled");
5453
}
5554

56-
@Flaky
5755
@Test
5856
@DisplayName("testExceptionReplayEnablement")
5957
void testExceptionReplayEnablement() throws Exception {
@@ -70,7 +68,7 @@ void testExceptionReplayEnablement() throws Exception {
7068
}
7169

7270
private void waitForFeatureStarted(String appUrl, String feature) throws IOException {
73-
String line = "INFO com.datadog.debugger.agent.DebuggerAgent - Starting " + feature;
71+
String line = "INFO com.datadog.debugger.agent.DebuggerAgent - Started " + feature;
7472
waitForSpecificLine(appUrl, line);
7573
LOG.info("feature {} started", feature);
7674
}

0 commit comments

Comments
 (0)