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

Having a locust "die" or stop after one task #161

Closed
arcoraven opened this issue May 22, 2014 · 6 comments
Closed

Having a locust "die" or stop after one task #161

arcoraven opened this issue May 22, 2014 · 6 comments

Comments

@arcoraven
Copy link

I'm trying to get an accurate number of how many users per second a particular endpoint I'm testing supports.

I'm not sure I like the min/max wait flags because it adds a bit of unknown into my data. For example, I don't know how long one task will take, so I can't accurately tell a user to "run this task precisely once per minute" (correct me if I'm wrong).

Is there a way I can tell a user to stop after running it's task once? That way, I can create 6k users spawning at 100 per sec. I'll know that I'm testing exactly 100 users per second for one minute.

P.S. This is similar to the "run through" each test once issue (#98), but that one references a deprecated command line flag.

@grahamrhay
Copy link

there is an (undocumented) StopLocust exception, which will stop that eventlet

@cedriclecoz
Copy link

Just what i was looking for :) thanks.

@ivoilic
Copy link

ivoilic commented Jun 17, 2019

@grahamrhay Any more info on this? Is there a reason it isn't in the docs?

@grahamrhay
Copy link

no idea, sorry. I have nothing to do with the project, I just found it trawling the code (trying to solve a similar problem)

I would assume it isn't documented, because it isn't a feature. so the usual caveats of (ab)using implementation details

@sklrsn
Copy link

sklrsn commented Oct 3, 2019

@grahamrhay Thanks.

@MaxAtkinson
Copy link

Update on this, I use the locust.exception.StopUser exception for this behaviour.

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

No branches or pull requests

7 participants