Order of checks displayed in stdout results output

I have a test where i have many checks on the reponse json and see that the checks displayed in the stdout results output is not in the order of the checks defined in the test case or not in a specific order.

This seems to be very random. Any existing issue that is being worked on ? or an expected behaviour? I would rather except the checks to be dispalyed in the order that is defined in the test.

export default function (data) {
    //http request here
    check(res, {"Upload:": (r) => r.status === 201 });
    //http request here
    check(res, {"Upload:": (r) => r.status === 201 });        
    //http request here
    check(res, {"Validate:": (r) => r.status === 200 });
    //http request here
    check(res, {"GET:": (r) => r.status === 200 });        
}

image

Thanks for reporting this, it’s a known issue that should hopefully be fixed in k6 v0.30.0 :crossed_fingers: The root cause is that the checks are currently kept in a Go map, with the check names as keys, and map iteration in Go is random… You can follow https://github.com/loadimpact/k6/issues/1316 and some of its connected issues for updates.

1 Like