Skip to content
Latchkey

datadog-ci "synthetics test failed" in CI

datadog-ci synthetics run-tests triggers your Synthetic tests and waits for results; when at least one test fails an assertion or times out, the command exits non-zero so CI fails the gate. The failure is a real test result, not a tooling error.

What this error means

datadog-ci synthetics run-tests reports "Failed" tests in its summary and exits with a non-zero code, e.g. "1 test failed", failing the job.

datadog-ci
[FAILED] Check homepage loads - https://app.datadoghq.com/synthetics/details/abc-def-ghi
  * Assertion failed: statusCode should be 200, got 503
datadog-ci synthetics: 1 test failed

Common causes

The deployed target genuinely failed a check

A Synthetic assertion (status code, response time, body content) did not pass against the environment under test, so the test result is Failed.

The test config selects the wrong environment

A wrong --variable (such as START_URL) points the test at an environment that is down or not yet deployed, producing a real failure.

How to fix it

Read the failed assertion and fix the target

  1. Open the result link printed by datadog-ci to see the failed assertion.
  2. Confirm the environment under test is healthy and fully deployed before running tests.
  3. Re-run after the deploy completes.

Override variables to target the right env

Pass the correct base URL so the Synthetic test hits the environment you just deployed.

Terminal
datadog-ci synthetics run-tests \
  --config synthetics.config.json \
  --variable START_URL="$DEPLOY_URL"

How to prevent it

  • Run Synthetic tests only after the deploy is fully live.
  • Pass environment URLs as variables, not hard-coded values.
  • Gate on the tests that matter so a real regression blocks release.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →