diff --git a/buildSrc/src/main/kotlin/datadog.configure-tests.gradle.kts b/buildSrc/src/main/kotlin/datadog.configure-tests.gradle.kts index f3a434856a2..777b6d8815b 100644 --- a/buildSrc/src/main/kotlin/datadog.configure-tests.gradle.kts +++ b/buildSrc/src/main/kotlin/datadog.configure-tests.gradle.kts @@ -101,6 +101,9 @@ tasks.withType().configureEach { develocity.testRetry { if (providers.environmentVariable("CI").isPresent()) { maxRetries = 3 + filter { + excludeAnnotationClasses.add("*NonRetryable") // allow to mark classes non retryable + } } } } diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/AgentDebuggerIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/AgentDebuggerIntegrationTest.java index fba8571a769..07e63faeba0 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/AgentDebuggerIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/AgentDebuggerIntegrationTest.java @@ -35,7 +35,9 @@ void testLatestJdk() throws Exception { snapshot -> { snapshotReceived.set(true); }); - processRequests(snapshotReceived::get); + processRequests( + snapshotReceived::get, + () -> String.format("timeout snapshotReceived=%s", snapshotReceived.get())); assertFalse(logHasErrors(logFilePath, it -> false)); } @@ -53,7 +55,9 @@ void testShutdown() throws Exception { snapshot -> { snapshotReceived.set(true); }); - processRequests(snapshotReceived::get); + processRequests( + snapshotReceived::get, + () -> String.format("timeout snapshotReceived=%s", snapshotReceived.get())); assertFalse(logHasErrors(logFilePath, it -> false)); // Wait for the app exit with some extra time. // The expectation is that agent doesn't prevent app from exiting. @@ -78,7 +82,9 @@ void testDestroy() throws Exception { snapshot -> { snapshotReceived.set(true); }); - processRequests(snapshotReceived::get); + processRequests( + snapshotReceived::get, + () -> String.format("timeout snapshotReceived=%s", snapshotReceived.get())); targetProcess.destroy(); // Wait for the app exit with some extra time. // The expectation is that agent doesn't prevent app from exiting. diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/BaseIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/BaseIntegrationTest.java index 132e7e8a823..4627c480c96 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/BaseIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/BaseIntegrationTest.java @@ -46,6 +46,7 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; +import java.util.function.Supplier; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.mockwebserver.MockResponse; @@ -118,6 +119,7 @@ static void setupAll() throws Exception { @BeforeEach void setup(TestInfo testInfo) throws Exception { + LOG.info("===== Starting {} ====", testInfo.getDisplayName()); datadogAgentServer = new MockWebServer(); probeMockDispatcher = new MockDispatcher(); probeMockDispatcher.setDispatcher(this::datadogAgentDispatch); @@ -132,13 +134,14 @@ void setup(TestInfo testInfo) throws Exception { } @AfterEach - void teardown() throws Exception { + void teardown(TestInfo testInfo) throws Exception { if (targetProcess != null) { targetProcess.destroyForcibly(); } datadogAgentServer.shutdown(); statsDServer.close(); ProbeRateLimiter.resetAll(); + LOG.info("===== Ending {} ====", testInfo.getDisplayName()); } protected ProcessBuilder createProcessBuilder(Path logFilePath, String... params) { @@ -347,14 +350,15 @@ protected AtomicBoolean registerCheckReceivedInstalledEmitting() { return result; } - protected void processRequests(BooleanSupplier conditionOfDone) throws InterruptedException { + protected void processRequests(BooleanSupplier conditionOfDone, Supplier timeoutMessage) + throws InterruptedException { long start = System.currentTimeMillis(); try { RecordedRequest request; do { request = datadogAgentServer.takeRequest(REQUEST_WAIT_TIMEOUT, TimeUnit.SECONDS); if (request == null) { - throw new RuntimeException("timeout!"); + throw new RuntimeException(timeoutMessage.get()); } LOG.info("processRequests path={}", request.getPath()); for (RequestType requestType : RequestType.values()) { @@ -364,7 +368,7 @@ protected void processRequests(BooleanSupplier conditionOfDone) throws Interrupt } } } while (request != null && (System.currentTimeMillis() - start < 30_000)); - throw new RuntimeException("timeout!"); + throw new RuntimeException(timeoutMessage.get()); } finally { probeStatusListeners.clear(); } diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/CodeOriginIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/CodeOriginIntegrationTest.java index 17d8c9b221e..7cb9f1582ca 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/CodeOriginIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/CodeOriginIntegrationTest.java @@ -51,6 +51,7 @@ void testCodeOriginTraceAnnotation() throws Exception { } } }); - processRequests(codeOrigin::get); + processRequests( + codeOrigin::get, () -> String.format("timeout codeOrigin=%s", codeOrigin.get())); } } diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ExceptionDebuggerIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ExceptionDebuggerIntegrationTest.java index 42c324a808e..a0ae482ff1f 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ExceptionDebuggerIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ExceptionDebuggerIntegrationTest.java @@ -10,17 +10,18 @@ import datadog.trace.bootstrap.debugger.CapturedContext; import datadog.trace.test.agent.decoder.DecodedSpan; import datadog.trace.test.agent.decoder.DecodedTrace; -import datadog.trace.test.util.Flaky; +import datadog.trace.test.util.NonRetryable; import java.nio.file.Path; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.function.Supplier; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIf; -@Flaky +@NonRetryable public class ExceptionDebuggerIntegrationTest extends ServerAppDebuggerIntegrationTest { private List snapshotIdTags = new ArrayList<>(); @@ -28,6 +29,11 @@ public class ExceptionDebuggerIntegrationTest extends ServerAppDebuggerIntegrati private boolean snapshotReceived; private Map snapshots = new HashMap<>(); private List additionalJvmArgs = new ArrayList<>(); + private Supplier timeoutMessage = + () -> + String.format( + "Timeout! traceReceived=%s snapshotReceived=%s #snapshots=%d", + traceReceived, snapshotReceived, snapshots.size()); @Override protected ProcessBuilder createProcessBuilder(Path logFilePath, String... params) { @@ -74,7 +80,8 @@ void testSimpleSingleFrameException() throws Exception { return true; } return false; - }); + }, + timeoutMessage); } @Test @@ -98,7 +105,7 @@ void testNoSubsequentCaptureAfterFirst() throws Exception { } } }); - processRequests(() -> traceReceived && !snapshotReceived); + processRequests(() -> traceReceived && !snapshotReceived, timeoutMessage); } // DeepOops exception stacktrace: @@ -163,7 +170,8 @@ void test3CapturedFrames() throws Exception { return true; } return false; - }); + }, + timeoutMessage); } @Test @@ -240,7 +248,8 @@ void test5CapturedFrames() throws Exception { return true; } return false; - }); + }, + timeoutMessage); } @Test @@ -276,7 +285,8 @@ void test3CapturedRecursiveFrames() throws Exception { return true; } return false; - }); + }, + timeoutMessage); } private static void assertRecursiveSnapshot(Snapshot snapshot) { @@ -321,7 +331,8 @@ void testLambdaHiddenFrames() throws Exception { return true; } return false; - }); + }, + timeoutMessage); } private void resetSnapshotsAndTraces() { diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/LogProbesIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/LogProbesIntegrationTest.java index 6e0f34e4da1..1f29eee9271 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/LogProbesIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/LogProbesIntegrationTest.java @@ -52,7 +52,9 @@ void testInaccessibleObject() throws Exception { snapshot -> { snapshotReceived.set(true); }); - processRequests(snapshotReceived::get); + processRequests( + snapshotReceived::get, + () -> String.format("timeout snapshotReceived=%s", snapshotReceived.get())); assertFalse(logHasErrors(logFilePath, it -> false)); } @@ -92,7 +94,12 @@ void testFullMethod() throws Exception { snapshotReceived.set(true); }); AtomicBoolean statusResult = registerCheckReceivedInstalledEmitting(); - processRequests(() -> snapshotReceived.get() && statusResult.get()); + processRequests( + () -> snapshotReceived.get() && statusResult.get(), + () -> + String.format( + "timeout snapshotReceived=%s statusResult=%s", + snapshotReceived.get(), statusResult.get())); } @Test @@ -119,7 +126,12 @@ void testFullMethodWithCondition() throws Exception { snapshotReceived.set(true); }); AtomicBoolean statusResult = registerCheckReceivedInstalledEmitting(); - processRequests(() -> snapshotReceived.get() && statusResult.get()); + processRequests( + () -> snapshotReceived.get() && statusResult.get(), + () -> + String.format( + "timeout snapshotReceived=%s statusResult=%s", + snapshotReceived.get(), statusResult.get())); } @Test @@ -148,7 +160,12 @@ void testFullMethodWithConditionAtExit() throws Exception { snapshotReceived.set(true); }); AtomicBoolean statusResult = registerCheckReceivedInstalledEmitting(); - processRequests(() -> snapshotReceived.get() && statusResult.get()); + processRequests( + () -> snapshotReceived.get() && statusResult.get(), + () -> + String.format( + "timeout snapshotReceived=%s statusResult=%s", + snapshotReceived.get(), statusResult.get())); } @Test @@ -176,7 +193,12 @@ void testFullMethodWithConditionFailed() throws Exception { snapshotReceived.set(true); }); AtomicBoolean statusResult = registerCheckReceivedInstalledEmitting(); - processRequests(() -> snapshotReceived.get() && statusResult.get()); + processRequests( + () -> snapshotReceived.get() && statusResult.get(), + () -> + String.format( + "timeout snapshotReceived=%s statusResult=%s", + snapshotReceived.get(), statusResult.get())); } @Test @@ -208,7 +230,12 @@ void testFullMethodWithLogTemplate() throws Exception { snapshotReceived.set(true); }); AtomicBoolean statusResult = registerCheckReceivedInstalledEmitting(); - processRequests(() -> snapshotReceived.get() && correctLogMessage.get() && statusResult.get()); + processRequests( + () -> snapshotReceived.get() && correctLogMessage.get() && statusResult.get(), + () -> + String.format( + "timeout snapshotReceived=%s correctLogMessage=%s statusResult=%s", + snapshotReceived.get(), correctLogMessage.get(), statusResult.get())); } @Test @@ -255,7 +282,12 @@ void testFullMethodWithCaptureExpressions() throws Exception { snapshotReceived.set(true); }); AtomicBoolean statusResult = registerCheckReceivedInstalledEmitting(); - processRequests(() -> snapshotReceived.get() && statusResult.get()); + processRequests( + () -> snapshotReceived.get() && statusResult.get(), + () -> + String.format( + "timeout snapshotReceived=%s statusResult=%s", + snapshotReceived.get(), statusResult.get())); } @Test @@ -296,7 +328,12 @@ void testMultiProbes() throws Exception { && statuses.values().stream() .allMatch(status -> status == ProbeStatus.Status.EMITTING)); }); - processRequests(() -> allSnapshotReceived.get() && allStatusEmitting.get()); + processRequests( + () -> allSnapshotReceived.get() && allStatusEmitting.get(), + () -> + String.format( + "timeout allSnapshotReceived=%s allStatusEmitting=%s", + allSnapshotReceived.get(), allStatusEmitting.get())); assertEquals(NB_PROBES, probeIds.size()); for (int i = 0; i < NB_PROBES; i++) { assertTrue(probeIds.contains(String.valueOf(i))); @@ -328,7 +365,12 @@ void testLineProbe() throws Exception { snapshotReceived.set(true); }); AtomicBoolean statusResult = registerCheckReceivedInstalledEmitting(); - processRequests(() -> snapshotReceived.get() && statusResult.get()); + processRequests( + () -> snapshotReceived.get() && statusResult.get(), + () -> + String.format( + "timeout snapshotReceived=%s statusResult=%s", + snapshotReceived.get(), statusResult.get())); } @Test @@ -386,7 +428,8 @@ private void doSamplingSnapshot(ProbeCondition probeCondition, MethodLocation ev () -> { LOG.info("snapshots={}", snapshotCount.get()); return snapshotCount.get() >= 2 && snapshotCount.get() <= 20; - }); + }, + () -> String.format("timeout snapshotCount=%d", snapshotCount.get())); } @Test @@ -420,7 +463,8 @@ void testSamplingLogDefault() throws Exception { () -> { LOG.info("snapshots={}", snapshotCount.get()); return snapshotCount.get() >= 850 && snapshotCount.get() <= 1000; - }); + }, + () -> String.format("timeout snapshotCount=%d", snapshotCount.get())); } @Test @@ -454,7 +498,8 @@ void testSamplingLogCustom() throws Exception { () -> { LOG.info("snapshots={}", snapshotCount.get()); return snapshotCount.get() > 0 && snapshotCount.get() < 200; - }); + }, + () -> String.format("timeout snapshotCount=%d", snapshotCount.get())); } @Test @@ -485,7 +530,9 @@ void testUncaughtException() throws Exception { throwable.getStacktrace().get(0).getFunction()); snapshotReceived.set(true); }); - processRequests(snapshotReceived::get); + processRequests( + snapshotReceived::get, + () -> String.format("timeout snapshotReceived=%s", snapshotReceived.get())); } @Test @@ -516,7 +563,9 @@ void testCaughtException() throws Exception { throwable.getStacktrace().get(0).getFunction()); snapshotReceived.set(true); }); - processRequests(snapshotReceived::get); + processRequests( + snapshotReceived::get, + () -> String.format("timeout snapshotReceived=%s", snapshotReceived.get())); } private ProbeId getProbeId(int i) { diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/MetricProbesIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/MetricProbesIntegrationTest.java index e25b2e5fed9..a0dcf1cb67e 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/MetricProbesIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/MetricProbesIntegrationTest.java @@ -109,7 +109,8 @@ private void doMethodMetric( String msgExpected = String.format(expectedMsgFormat, metricName, PROBE_ID.getId()); assertNotNull(retrieveStatsdMessage(msgExpected)); AtomicBoolean statusResult = registerCheckReceivedInstalledEmitting(); - processRequests(statusResult::get); + processRequests( + statusResult::get, () -> String.format("timeout statusResult=%s", statusResult.get())); } private void doMethodInvalidMetric( @@ -140,7 +141,9 @@ private void doMethodInvalidMetric( error.set(true); } }); - processRequests(() -> received.get() && error.get()); + processRequests( + () -> received.get() && error.get(), + () -> String.format("timeout received=%s error=%s", received.get(), error.get())); } @Test @@ -213,6 +216,7 @@ private void doLineMetric( String msgExpected = String.format(expectedMsgFormat, metricName, PROBE_ID.getId()); assertNotNull(retrieveStatsdMessage(msgExpected)); AtomicBoolean statusResult = registerCheckReceivedInstalledEmitting(); - processRequests(statusResult::get); + processRequests( + statusResult::get, () -> String.format("timeout statusResult=%s", statusResult.get())); } } diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ProbeStateIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ProbeStateIntegrationTest.java index ffe609b764e..69110743a7c 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ProbeStateIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ProbeStateIntegrationTest.java @@ -159,6 +159,8 @@ public void testProbeStatusError() throws Exception { error.set(true); } }); - processRequests(() -> received.get() && error.get()); + processRequests( + () -> received.get() && error.get(), + () -> String.format("timeout received=%s error=%s", received.get(), error.get())); } } diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ServerAppDebuggerIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ServerAppDebuggerIntegrationTest.java index fa44b4f5e79..06b23da1df7 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ServerAppDebuggerIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ServerAppDebuggerIntegrationTest.java @@ -52,12 +52,12 @@ void setup(TestInfo testInfo) throws Exception { @Override @AfterEach - void teardown() throws Exception { + void teardown(TestInfo testInfo) throws Exception { if (appUrl != null) { stopApp(appUrl); } controlServer.shutdown(); - super.teardown(); + super.teardown(testInfo); } @Override @@ -82,7 +82,9 @@ protected void stopApp(String appUrl) throws IOException { protected Snapshot waitForOneSnapshot() throws Exception { AtomicReference snapshotReceived = new AtomicReference<>(); registerSnapshotListener(snapshotReceived::set); - processRequests(() -> snapshotReceived.get() != null); + processRequests( + () -> snapshotReceived.get() != null, + () -> String.format("timeout snapshotReceived=%s", snapshotReceived.get())); return snapshotReceived.get(); } @@ -119,7 +121,9 @@ protected void waitForInstrumentation( installed.set(true); } }); - processRequests(() -> received.get() && installed.get()); + processRequests( + () -> received.get() && installed.get(), + () -> String.format("timeout received=%s installed=%s", received.get(), installed.get())); } LOG.info("instrumentation done"); } @@ -130,7 +134,8 @@ protected void waitForAProbeStatus(ProbeStatus.Status status) throws Exception { probeStatus -> { statusResult.set(probeStatus.getDiagnostics().getStatus() == status); }); - processRequests(statusResult::get); + processRequests( + statusResult::get, () -> String.format("timeout statusResult=%s", statusResult.get())); } protected void waitForReTransformation(String appUrl) throws IOException { diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanDecorationProbesIntegrationTests.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanDecorationProbesIntegrationTests.java index 3d1fc4d3c0a..eb344e25348 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanDecorationProbesIntegrationTests.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanDecorationProbesIntegrationTests.java @@ -73,7 +73,8 @@ void testMethodSimpleTagNoCondition() throws Exception { } } }); - processRequests(traceReceived::get); + processRequests( + traceReceived::get, () -> String.format("timeout traceReceived=%s", traceReceived.get())); } @Test @@ -120,7 +121,8 @@ void testMethodMultiTagsMultiConditions() throws Exception { } } }); - processRequests(traceReceived::get); + processRequests( + traceReceived::get, () -> String.format("timeout traceReceived=%s", traceReceived.get())); } @Test @@ -159,7 +161,11 @@ void testMethodSimpleTagValueError() throws Exception { } } }); - processRequests(() -> snapshotTest.get() && spanTest.get()); + processRequests( + () -> snapshotTest.get() && spanTest.get(), + () -> + String.format( + "timeout snapshotTest=%s spanTest=%s", snapshotTest.get(), spanTest.get())); } @Test @@ -200,7 +206,11 @@ void testMethodSimpleTagConditionError() throws Exception { } } }); - processRequests(() -> snapshotTest.get() && spanTest.get()); + processRequests( + () -> snapshotTest.get() && spanTest.get(), + () -> + String.format( + "timeout snapshotTest=%s spanTest=%s", snapshotTest.get(), spanTest.get())); } @Test @@ -247,7 +257,11 @@ void testMethodMultiTagValueError() throws Exception { } } }); - processRequests(() -> snapshotTest.get() && spanTest.get()); + processRequests( + () -> snapshotTest.get() && spanTest.get(), + () -> + String.format( + "timeout snapshotTest=%s spanTest=%s", snapshotTest.get(), spanTest.get())); } @Test @@ -277,7 +291,7 @@ void testSamplingSpanDecoration() throws Exception { } } }); - processRequests(() -> count.get() >= 100); + processRequests(() -> count.get() >= 100, () -> String.format("timeout count=%d", count.get())); } private SpanDecorationProbe.Decoration createDecoration(String tagName, String valueDsl) { diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanProbesIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanProbesIntegrationTest.java index 48d23641b6a..5afbb91b545 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanProbesIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanProbesIntegrationTest.java @@ -40,7 +40,12 @@ void testMethodSpan() throws Exception { assertEquals("Main.fullMethod", decodedSpan.getResource()); traceReceived.set(true); }); - processRequests(() -> statusResult.get() && traceReceived.get()); + processRequests( + () -> statusResult.get() && traceReceived.get(), + () -> + String.format( + "timeout statusResult=%s traceReceived=%s", + statusResult.get(), traceReceived.get())); } @Test @@ -65,7 +70,12 @@ void testLineRangeSpan() throws Exception { assertEquals("Main.fullMethod:L88-97", decodedSpan.getResource()); traceReceived.set(true); }); - processRequests(() -> statusResult.get() && traceReceived.get()); + processRequests( + () -> statusResult.get() && traceReceived.get(), + () -> + String.format( + "timeout statusResult=%s traceReceived=%s", + statusResult.get(), traceReceived.get())); } @Test @@ -98,6 +108,8 @@ void testSingleLineSpan() throws Exception { error.set(true); } }); - processRequests(() -> received.get() && error.get()); + processRequests( + () -> received.get() && error.get(), + () -> String.format("timeout received=%s error=%s", received.get(), error.get())); } } diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/TracerDebuggerIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/TracerDebuggerIntegrationTest.java index 6300b376f7a..1ba4032d296 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/TracerDebuggerIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/TracerDebuggerIntegrationTest.java @@ -83,7 +83,9 @@ void testTracer(boolean processTagsEnabled) throws Exception { requestReceived.set(true); }); doTestTracer(logProbe, processTagsEnabled); - processRequests(requestReceived::get); + processRequests( + requestReceived::get, + () -> String.format("timeout requestReceived=%s", requestReceived.get())); } @Test @@ -115,7 +117,9 @@ void testTracerDynamicLog() throws Exception { requestReceived.set(true); }); doTestTracer(logProbe); - processRequests(requestReceived::get); + processRequests( + requestReceived::get, + () -> String.format("timeout requestReceived=%s", requestReceived.get())); } @Test @@ -144,7 +148,9 @@ void testTracerSameMethod() throws Exception { requestReceived.set(true); }); doTestTracer(logProbe); - processRequests(requestReceived::get); + processRequests( + requestReceived::get, + () -> String.format("timeout requestReceived=%s", requestReceived.get())); } @Test @@ -173,7 +179,9 @@ void testTracerLineSnapshotProbe() throws Exception { requestReceived.set(true); }); doTestTracer(logProbe); - processRequests(requestReceived::get); + processRequests( + requestReceived::get, + () -> String.format("timeout requestReceived=%s", requestReceived.get())); } @Test @@ -202,7 +210,9 @@ void testTracerLineDynamicLogProbe() throws Exception { requestReceived.set(true); }); doTestTracer(logProbe); - processRequests(requestReceived::get); + processRequests( + requestReceived::get, + () -> String.format("timeout requestReceived=%s", requestReceived.get())); } private void doTestTracer(LogProbe logProbe) throws Exception { diff --git a/utils/test-utils/src/main/groovy/datadog/trace/test/util/NonRetryable.java b/utils/test-utils/src/main/groovy/datadog/trace/test/util/NonRetryable.java new file mode 100644 index 00000000000..ecfb3cf3179 --- /dev/null +++ b/utils/test-utils/src/main/groovy/datadog/trace/test/util/NonRetryable.java @@ -0,0 +1,21 @@ +package datadog.trace.test.util; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import org.junit.jupiter.api.Tag; + +/** + * Use this annotation for test cases that are not designed to be retryable (gradle retry plugin / + * develocity). + * + *

Retry plugin doc. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE, ElementType.METHOD}) +@Tag("NonRetryable") +public @interface NonRetryable { + /** Reason why the test is non-retryable (optional). */ + String value() default ""; +}