Loop one scenario vs loop in one scenario

Hi
When I have one test in scenario, I get a lot of lock errors when browser restarts:

ERRO[0084] cleaning up the user data directory: remove C:\Users\mobj\AppData\Local\Temp\xk6-browser-data-81919410\lockfile: The process cannot access the file because it is being used by another process.  category="Browser:Close" elapsed="0 ms" source=browser
ERRO[0084] cleaning up the user data directory: remove C:\Users\mobj\AppData\Local\Temp\xk6-browser-data-1788123074\lockfile: The process cannot access the file because it is being used by another process.  category="Browser:Close" elapsed="0 ms" source=browser
ERRO[0084] cleaning up the user data directory: remove C:\Users\mobj\AppData\Local\Temp\xk6-browser-data-389242499\lockfile: The process cannot access the file because it is being used by another process.  category="Browser:Close" elapsed="0 ms" source=browser

But if I do a for loop of random users inside the scenario so the scenario never finishes and do not close and restart the browser performance is way way higher:

Both have vus=5

So you should start up the browsers instance you need up front and never restart them.

This sounds similar to this existing issue.

1 Like

I often see the same with selenium/chromedriver (one for each testrun) and ends up with lots of running chrome instances I have to manually shut down because it has eaten up all the memory.

Hmm, it sounds like an underlying issue with Chromium :thinking: