-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
Brief summary
Description:
When running a test with no failed HTTP requests (http_req_failed rate = 0.00%), the k6 CLI raw output and JSON results show the http_req_failed pass and fail counts reversed. Specifically, the failure rate is correctly reported as 0.00%, but the pass count is shown as 0 and the fail count as the total number of requests, which is misleading.
Example snippet from raw output:
http_req_failed................: 0.00% ✓ 0 ✗ 21
http_reqs......................: 21
Impact:
This can cause confusion interpreting test results, as the failure rate and counts appear inconsistent.
Additional notes:
The failure rate metric itself is correct, so this appears to be a display/reporting issue for the http_req_failed metric pass/fail counts.
k6 version
k6 v1.6.1 (commit/2ac2bb560e, go1.25.6,)
OS
linux/amd64
Docker version and image (if applicable)
No response
Steps to reproduce the problem
- Create a simple k6 script that makes a number of HTTP requests, all expected to succeed. For example:
import http from 'k6/http';
import { check } from 'k6';
export default function () {
const res = http.get('https://test-api.k6.io');
check(res, {
'status is 200': (r) => r.status === 200,
});
}
- Run the test with 20+ iterations (e.g., k6 run --iterations 21 script.js).
- Observe the CLI or JSON output for the http_req_failed metric:
http_req_failed................: 0.00% ✓ 0 ✗ 21
Note that the failure rate is 0.00% but pass count is 0 and fail count equals total requests.
Expected behaviour
- Pass count (✓) should be equal to the total requests (21 in this case).
- Fail count (✗) should be zero since failure rate is 0.00%.
Actual behaviour
- Pass count is 0.
- Fail count equals the total number of requests.
Reactions are currently unavailable
