-
Notifications
You must be signed in to change notification settings - Fork 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
Start on_stop not before on_start has finished #969
Comments
I havent validated the behaviour you are seeing, but it definitely looks like a bug, or at least a feature we would want. |
This is not supposed to happen within the same Locust I think. If it does happen I'd really like to see a minimal reproducible example. It's definitely possible that |
Sorry, I realised what I wrote in the previous message is incorrect. For some reason I thought you meant that on_stop could run before on_start, but I can clearly see that's not what you wrote. It's correct that with the current implementation we do not wait for on_start to finish when the test is stopped. Instead the Locusts' greenlets are immediately killed which could happen while on_start is still being executed if it's long running, or the test is stopped very quickly after it has been started. I think #1099 might be able to change this behaviour though. |
Yes, this is pretty much solved by #1099 . I added a test case to verify it, and will PR it later (it turns out on_start and on_stop are not tested anywhere...) |
Description of issue / feature request
Wait with running
on_stop
untilon_start
has finished. This is becauseon_stop
could depend on variables / statuses set duringon_start
:[Edit]
Same case for tasks. The
on_stop
method would maybe not cleanup resources from the currently running task:The text was updated successfully, but these errors were encountered: