Load Testing · Junior · Question 19 of 75
What does check() do in k6?
check(res, {
'status is 200': (r) => r.status === 200,
});- 1Retries the request until the condition becomes true
- 2Records whether a condition passed, without stopping the test
- 3Stops the virtual user immediately if the condition is false
Show the answer
Correct answer: Records whether a condition passed, without stopping the test
Explanation
Checks are like assertions that don't abort anything. k6 counts passes and failures and shows the pass rate in the summary.