-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON.parse SyntaxError when running a duration test #358
Comments
@liclac @gewfy This issue appears at the end of the test, and if you use a script that either idles the VUs at the end, or sleeps after the last HTTP request of the iteration, the bug is not triggered (e.g. running a 5-second test and not issuing any HTTP requests past the first 4 seconds of the test will not trigger it). This makes it seem like it may be a matter of a faulty teardown order somewhere, in a code path that only happens when you use This the smallest script that will trigger the EOF error (
Now, if I add a sleep anywhere after the HTTP request the error disappears:
...but if I move the sleep to before the HTTP request the error is still triggered:
So, my conclusion is that the error is triggered when Wild guess: could it be something introduced with the new buffer pool code - |
This looks like an issue wrt how VUs are scheduled, I'll do some poking around. |
I am using k6 to check performance for one of our endpoints and the endpoint requires using access token so the script fails very intermittently at line var obj_accesstoken = JSON.parse(res_accesstoken.body, sleep(1.0)); ERRO[0004] SyntaxError: EOF I tried adding sleep after http call and after json parse still the exception happens . Below is my code |
@elimatripathy, please do not comment in issues that have been closed for more than 5 years... Moreover, the GitHub issues are not the place to ask such questions, please use the community forum at https://community.k6.io/ |
This issue is related to #339 and #340
But I've reproduced this without using
stages
orrambda
. The error happens if you set any form of duration e.g.k6 run --duration 5s test.js
This tiny test:
The above test produces the
SyntaxError
problem but no check errors:The text was updated successfully, but these errors were encountered: