-
Notifications
You must be signed in to change notification settings - Fork 223
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
Sleep pauses entire execution including websocket intervals #1070
Comments
The old k6 I will move this issue to the docs repository, since we probably need to adjust the documentation and discourage users from using
It is, k6 also has |
I do wonder though ... what to do? I do think it is too early to outright be "don't use any syncrhnouns calls - use only async ones". There are both IMO too many sharp corners and not enough support. Even I also don't really want to go to every API and be "This is syncrhouns call - do not use with asynchrnous calls if possible." and the reverse :(. Having a general explanation around synchrouns and asyncrhouns calls and the event loop, seems like the best call - but the again it needs to be linked from everywhere. So I would prefer if we first figure out what the plan is before somebody spends days writing and editing a ton of pages. |
Thanks for the awesomely rapid feedback guys! Reading your comments helped me grasp the change I had to make and now I'm using either a |
Brief summary
Using sleep() with durations longer than 30 seconds cause our websocket sessions to get disconnected by the server because ping is not firing despite it being in an interval
k6 version
k6 v0.42.0
OS
macOS
Docker version and image (if applicable)
No response
Steps to reproduce the problem
I'm using the experimental support for Websockets & in an
setInterval
callingsocket.ping()
If I add
sleep(45)
after connecting the websocket, when the sleep ends the server has already disconnected the socket due to lack of pings.Expected behaviour
Ideally intervals & timers & timeouts should continue despite calls to
sleep()
, or perhaps a different type of sleep might need to be supported?Actual behaviour
The ping calls don't get attempted until after
sleep()
ends. Not sure what the legacy socket behaviour is...The text was updated successfully, but these errors were encountered: