Skip to content
Latchkey

Perl "Failed test" / "make test ... FAILED" in CI

A test file printed one or more "not ok" lines, so the TAP harness (prove or make test) reports failures and exits non-zero. The summary lists which tests failed and how many.

What this error means

The test phase ends with "Failed test" details and a summary like "Result: FAIL" or "make: *** [test] Error 1", failing the job.

prove
t/basic.t .. 1/5
#   Failed test 'parses date'
#   at t/basic.t line 22.
Failed 1/5 subtests
Test Summary Report
-------------------
t/basic.t (Wstat: 256 Tests: 5 Failed: 1)
Result: FAIL

Common causes

A genuine assertion failure

The code returned a value the test did not expect; the "Failed test" line names the assertion and the file/line.

An environment difference between local and CI

Locale, timezone, missing service, or a dependency version differs in CI, so a test that passes locally fails on the runner.

How to fix it

Run the failing file verbosely

  1. Re-run just the failing test with prove -v to see the diagnostic output.
  2. Compare expected vs got in the "Failed test" block.
  3. Fix the code or make the test deterministic (pin locale, timezone, versions).
Terminal
prove -lv t/basic.t

Pin the environment the tests assume

Set locale and timezone explicitly so CI matches the assumptions in the tests.

.github/workflows/ci.yml
env:
  LC_ALL: C.UTF-8
  TZ: UTC

How to prevent it

  • Make tests deterministic: pin locale, timezone, and dependency versions.
  • Run the full suite locally with prove before pushing.
  • Provide required services (databases, ports) to the CI job.

Related guides

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