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: FAILCommon 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
- Re-run just the failing test with prove -v to see the diagnostic output.
- Compare expected vs got in the "Failed test" block.
- Fix the code or make the test deterministic (pin locale, timezone, versions).
Terminal
prove -lv t/basic.tPin 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: UTCHow 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
Perl "prove: No such file or directory" (-l / t) in CIFix "prove: No such file or directory" in CI - prove was pointed at a test file or directory that does not ex…
Perl "Can't locate Test/More.pm" (Test::More not found) in CIFix "Can't locate Test/More.pm in @INC" in CI - the test suite requires Test::More but the runner Perl has no…
Perl taint mode "Insecure dependency in ..." in CIFix Perl taint-mode "Insecure dependency in system while running with -T switch" in CI - a tainted value from…