20% of checks failed, but k6 still exited with code 0 and CI passed.

BeginnerTroubleshootingk6 Load Testing
Answer

Likely causes → check() only records results; it does not fail the test. Only thresholds affect the exit code.

Diagnose → Look at the summary: checks.........: 80.00% with no threshold listed.

Fix → Add a threshold on checks:

thresholds: { checks: ['rate>0.99'] }

Prevent → Template scripts with SLO thresholds on http_req_failed, http_req_duration and checks.

All SRE & Reliability questions Roadmap: SRE & incident response

More on k6 Load Testing