Skip to content

Commit 9eb11aa

Browse files
bm1549claude
andcommitted
Use RuntimeException for liveness check to actually fail fast
PollingConditions.eventually only retries AssertionError. The liveness check was throwing AssertionError, so a dead process still waited the full 30s timeout. Switch to RuntimeException so it propagates immediately. Also narrow the catch from Throwable to AssertionError. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent b152541 commit 9eb11aa

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,17 +365,16 @@ abstract class LogInjectionSmokeTest extends AbstractSmokeTest {
365365
}
366366
if (testedProcess != null && !testedProcess.isAlive()) {
367367
def lastLines = tailProcessLog(20)
368-
throw new AssertionError(
368+
// RuntimeException (not AssertionError) so PollingConditions propagates
369+
// immediately instead of retrying for the full timeout.
370+
throw new RuntimeException(
369371
"Process exited with code ${testedProcess.exitValue()} while waiting for ${count} traces " +
370372
"(received ${traceCount.get()}, RC polls: ${rcClientMessages.size()}).\n" +
371373
"Last process output:\n${lastLines}")
372374
}
373375
assert traceCount.get() >= count
374376
}
375-
} catch (Throwable e) {
376-
if (e instanceof AssertionError && e.message?.startsWith("Process exited")) {
377-
throw e // Already enriched — don't wrap again
378-
}
377+
} catch (AssertionError e) {
379378
// The default error ("Condition not satisfied after 30s") is useless — enrich with diagnostic state
380379
def alive = testedProcess?.isAlive()
381380
def lastLines = tailProcessLog(30)

0 commit comments

Comments
 (0)