You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Previous versions of Locust included an event called locust_start_hatching. This event was similar to test_start, except that it was fired on all threads, not just on the master thread, when distributed. There was even a separate master_start_hatching that functioned identically to test_start does currently, so the removal of the locust_start_hatching event seems to be a pure loss of functionality, which one of my projects relied on. It is useful for my worker threads to instantiate certain data at the time of test initialization, which is currently only possible through some very unfortunate hacks.
Describe the solution you'd like
The addition of an event that fires when any thread starts a test
Describe alternatives you've considered
My current hack is to check if the required data has been initialized in all of my user constructors, and initialize it there if not. This is obviously not a good solution.
Additional context
The event was removed in commit 220f9cea, seemingly because its purpose was unclear and it was missing tests. Hopefully this feature request can clarify its purpose, but if not I'd be happy to expound upon it further.
The text was updated successfully, but these errors were encountered:
I agree, that does sound like a loss of functionality. Tbh, I think the appropriate solution is making test_start fire on all nodes (you could then check the environment.runner type to see if you are on master or slave, as needed). I think that was probably the way it was intended - I just documented it the way @heyman implemented it.
Any chance you could contribute such a fix? (and update the docs accordingly, maybe with an example that shows how to check master/slave) I dont think I have time for this...
Is your feature request related to a problem? Please describe.
Previous versions of Locust included an event called
locust_start_hatching
. This event was similar totest_start
, except that it was fired on all threads, not just on the master thread, when distributed. There was even a separatemaster_start_hatching
that functioned identically totest_start
does currently, so the removal of thelocust_start_hatching
event seems to be a pure loss of functionality, which one of my projects relied on. It is useful for my worker threads to instantiate certain data at the time of test initialization, which is currently only possible through some very unfortunate hacks.Describe the solution you'd like
The addition of an event that fires when any thread starts a test
Describe alternatives you've considered
My current hack is to check if the required data has been initialized in all of my user constructors, and initialize it there if not. This is obviously not a good solution.
Additional context
The event was removed in commit 220f9cea, seemingly because its purpose was unclear and it was missing tests. Hopefully this feature request can clarify its purpose, but if not I'd be happy to expound upon it further.
The text was updated successfully, but these errors were encountered: