-
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
aborting task in on_start #435
Comments
What is it that you want to happen when it fails in on_start? |
My memory is a bit foggy on the topic, anyway i think consider the creation of the locust instance as failed but continue with the hatch of the others. |
I see. That's not something that is currently supported and unless there's a strong use-case for it, I don't think it's something that will be implemented in Locust. However, I guess the result in your case was that the failed locust instances stopped, but the ones that didn't failed continued to execute. Which might be sort of equivalent of having some kind of failed state (even though the logs were filled with stacktraces)? |
Ping in 2024. My use case is that I want the Locust user to abort if authentication fails because all subsequent calls by that user will fail due to auth errors. |
I have the same use case |
I call a function that may fail in TaskSet.on_start
I've added a self.interrupt(reschedule=False) call if the function fail but the docstring of the that method says i should not do that from the root taskset.
And in fact i got these errors logged:
How can i avoid to run a task i know would return an error?
The text was updated successfully, but these errors were encountered: