Hello,
I’m using k6 for a bit of time now. I’m testing a specific usecase when I create an object and do some other http call (I mimic the behavior of a mobile app in order to test the backend). Then some async stuff is done in the backend side to “finalize” that object. Currently, the test does a “GET” on this object to check it has been finalized “at the right time”, since the mobile app does the same.
Now there is a change in the usecase from mobile side, they will not do the “GET” at the end of the usecase. However, since we already found some issue with the async stuff (for instance, the object is not saved in database, so impossible to “GET” afterward), I still want to check that the object can be retrieved at some point.
I don’t want to add a sleep inside my default function, since the “GET” is not part of the usecase anymore and it will not mimic the mobile app behavior. So I imagine I could somehow collect the id’s of the created objects during the test and try to get them at teardown stage. It will give reasonable time for the async stuff to be done.
I know you cannot pass data from default to teardown stage, and I’m not sure if I would introduce a redis server for this case. My idea would be to write some info in a file and then reopen the file (in the teardown or in another separate test), but I don’t know what would be the acceptable solution here.
Since my usecase is complicated, don’t hesitate to ask for some clarifications.
I’m looking forward to your help.
Thanks!