Hello, I have the following question regarding websocket testing.
Our current use-case is the following:
We have 1000 users, who are logging in the platform and doing different actions.
For every actions we are getting an update (passive one) via websocket.
So we have a csv file with these 1000 users and I two scenarios:
First one is doing → login and some actions (using loops)
Second one is doing login → connect to websocket and listening for updates.
However this approach is a bit “rough” and we cannot easily control when user finished with the actions and is logouting from the platform, so need to call websocket close action for this one.
What should be the best approach, using K6 to achieve such use-case?
we cannot easily control when user finished with the actions
and
so need to call websocket close action for this one.
I guess you are having problem defining what it means for the user to be “done”.
But either:
this is a test design problem of “we need to have this defined” in which case I can’t really tell you what to do as this is your design requirement.
or you can just keep doing actions with each user for the whole duration of the test. Either using setTimeout to set it to ws.close at the end of test/scenario duration or just let k6 kill it after gracefulShutdown runs out.
Hope this helps you! If not please expand on the problem definition