Skip to content
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

Locust exits with 1 on timeouts / errors #560

Closed
thebostik opened this issue Mar 8, 2017 · 3 comments · Fixed by #992
Closed

Locust exits with 1 on timeouts / errors #560

thebostik opened this issue Mar 8, 2017 · 3 comments · Fixed by #992

Comments

@thebostik
Copy link

Depending on how others are deploying this tool from the command line it may be a non-issue, but it's causing problems for us. Returning non-zero with the same code that we use when there are misconfigurations for, say, one 500 response code out of thousands is not subtle enough.

By the time we exit in this case, the entire test was already completed and requests were sent. Whatever downstream metrics systems will have valid data, etc. If we retry based on a non-zero exit code, we run the test twice. Users of the tool should probably be doing something more intelligent downstream to determine if the test was a failure or not than if there was at least 1 error. So why exit with an error code?

Two initial ideas that could improve the behavior (either or both would work):

  1. Use a return code that's unique to this kind of "failure but not really", so it can be handled and ignored / logged with the correct criticality
  2. Add a new command line parameter that is a threshold for failure (percent using stats.fail_ratio and/or absolute compared against num_requests)

Is this bothering anyone else?
(ref)

@heyman
Copy link
Member

heyman commented Mar 10, 2017

Hm, I agree. Maybe we could just make it so that one could set locust.runners.locust_runner.exit_code, and if it's set it'll be returned when the program exists. If it's no set, it'll use the current behaviour?

@aldenpeterson-wf
Copy link
Contributor

aldenpeterson-wf commented Jul 13, 2018

I wonder if something like --failure-threshold=0.05 as a command line arg would be a good way to handle this?

I'm not sure a good name there (naming is hard) but it seems better to add that as an opt-in optional feature than to change the default exit behavior.

@Stateford
Copy link
Contributor

I would like the option to opt-out of this. It's fairly annoying that one error will post a non-zero error code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants