response = http.get("https://some_url);
check(response, {
'Getting the data OK': (r) => r.status === 200),
});
Sometimes I get an “context deadline exceeded k6” error.
However, when that happens, my check is still green.
Does it mean that the current iteration is exiting on timeouts, so the check is never run?
If no, what is the status of an timed-out request?
We set the status to 0 when there is a timeout, and a timeout will not cause the iteration to end (you would have to use fail in order to do this).
I’m not able to reproduce this locally; my check definitely fails when a response took longer than the default timeout of 60s:
WARN[0060] Request Failed error="Get \"http://localhost:8080\": context deadline exceeded"
✗ Getting the data OK
↳ 0% — ✓ 0 / ✗ 1
The code excerpt you’ve included in your post won’t actually compile, so I’m guessing this isn’t actually what you are running (URL string missing closing double-quotes; extra ), in the check function). Perhaps the check you have isn’t doing what you think it is?
Is that POST URL in the stack trace what vars["loginForm"] resolves to? Any chance you could share the code for the request immediately preceding the one on 110?
You seem to have enabled the throw option, which as documented makes failed http requests into exceptions. “failed” here means ones that we totally didn’t managet to make or were not able to be finished in “unpredicatable” way as is the case with a timeout.