audit-test-failures
Diagnose the root cause of a test that fails intermittently, passes locally but fails in CI, or only fails when run alongside other tests.
What This Command Does
Launches the test-failure-analyzer agent, which scans test files for the concurrency and isolation patterns that produce non-deterministic failures, and reports each with a root cause rather than just a location.
This is the diagnostic counterpart to audit-testing. Reach for testing to survey overall suite quality; reach for test-failures when a specific test is already misbehaving and you need to know why.
What It Checks
- Missing
await confirmation– async work with no wait, so the test finishes before the callback fires - Missing
@MainActor– UI tests touching main-actor-isolated state without isolation - Shared mutable state in a
@Suite– parallel tests mutating the same collection Task.sleepstanding in for a wait – timing assumptions that hold on a fast machine and break in CI- Missing
.serializedtrait – tests that cannot safely run in parallel but are not marked - Test-generated crashes – force unwraps and precondition failures inside test code
- Date comparisons in
#expect– assertions that depend on wall-clock timing
Usage
/axiom:audit test-failuresRelated
- test-failure-analyzer – The agent that powers this command
- audit-testing – Suite-wide quality survey rather than one failing test
- test-debugger – Closed-loop debugging that re-runs tests until they pass, once you know the cause
- run-tests – Run tests and parse the
.xcresultfor failures