Monk CIMonk CI home

22 Nov, 2026Aishwarya Palta

Flaky Test or Runner Failure? A CI Triage Guide


Separate a flaky test from a runner failure using job logs, runner diagnostics and controlled retries. Follow a practical GitHub Actions triage checklist.

To distinguish a flaky test or runner failure, find where execution stopped before pressing rerun. A passing retry shows that the outcome changed; it does not identify whether the cause was test timing, external state or infrastructure.

Our developer approach: preserve evidence, classify the failure, then change one variable. This avoids hiding recurring problems behind automatic retries.

Did the test process actually start?

Open the first failing step and read the surrounding output. GitHub’s workflow logs include setup and completion steps, so failures before your test command deserve a different investigation from assertion failures.

EvidenceFirst investigation
Checkout or action download failedNetwork, permissions or service availability
Assertion failed with a stack traceTest inputs, ordering and application behavior
Process disappeared or logs stoppedMemory pressure, timeout, cancellation or runner loss
Database connection refusedService readiness and network configuration

These are starting points, not diagnoses. A resource leak in application code can also exhaust a runner.

What should you save before retrying?

Record the commit, workflow attempt, runner label, toolchain versions, failing test and seed. Preserve service logs and test reports alongside the job logs; a later successful run may overwrite temporary files.

With an authenticated GitHub CLI, replace the run ID and inspect the original attempt:

gh run view RUN_ID --attempt 1 --log-failed

The CLI reference documents attempt selection. For self-managed runners, inspect Runner_ and Worker_ files under _diag; ephemeral-runner diagnostics need external retention. See runner troubleshooting.

How do you narrow the cause?

  1. Repeat the same commit and test with the same seed and concurrency.
  2. Run the test alone, then in its original suite. A difference suggests shared state or ordering worth investigating.
  3. Compare a fresh environment while keeping dependencies and commands fixed. Record every attempt, including failures.

Use Run History to locate related failures. An AI log summary can guide inspection; verify its conclusion against logs before requesting a Debug Agent fix.

The useful outcome is an explained failure and a targeted correction ,not merely a green retry.

Try Monk CI for free

Continue with GitHub