-
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
Event spawning_complete fires every time a user is created #2671
Comments
It is kind of a bug. I think the issue was introduced in 2.0. It could be reimplemented on master side, but workers dont really know when spawning has finished so it will be hard to make it work the way it used to. |
@cyberw the event is correctly called on master side, when all users have spawned. So I found a kinda ugly workaround:
|
(Would be great if all the events receive the |
Well, when you say it like that, implementing spawning_completed on workers based on a message from master should be pretty easy :) If you feel like contributung this then a PR would be most welcome, if not lets keep this ticket open for later. |
@cyberw Sorry I read let's NOT keep it open 😊 |
Fixed in #2728 |
Prerequisites
Description
The event spawning_complete is fired everytime a user is created inside a worker instead of when all users in the worker have spawned. Is it a bug or the intended behaviour ? If so, what can I do to fire a callback when all users inside a worker have spawned ?
Prints:
SPAWN 1
SPAWN 1
SPAWN 2
SPAWN 2
SPAWN 3
(I have 2 workers and set user count to 5 with a spawn rate of 1 in the GUI)
Instead, I expected only "SPAWN 3"
To add more details of what I want to do: I want to disable http decompression (there isn't a built-in option in the FastHTTPClient to do this, so I do
zlib.decompress = lambda *a, **b: None
, it's kinda hacky I know) once all users have started (after all users have completed theiron_start
method).Command line
locust --worker
Locustfile contents
Python version
3.11
Locust version
2.24.1
Operating system
Linux CentOS
The text was updated successfully, but these errors were encountered: