locust icon indicating copy to clipboard operation
locust copied to clipboard

Command line option to specify the duration to run

Open uday-rayala opened this issue 13 years ago • 4 comments

We currently run locust tests manually with someone keeping track of the time. And we will stop the tests after 'x' minutes. We now want to automate running of locust tests in Continuous Integration server. But I dont see a command line option in locust to specify the duration to run the tests. This makes it very hard to integrate with CI server.

uday-rayala avatar May 09 '13 06:05 uday-rayala

You could try the stop_timeout field in the Locust class, which is the number of seconds after which the locust will die. If it's None, it won't timeout.

It will be something like this:

class MyLocust(Locust):
   task_set = MyTaskSet
   stop_timeout = 10
   ...

Alternatively, if you must use a command line option, you could use the -c/--clients option which specifies the number of clients to spawn and then stop. And if you can estimate how many clients are created in 'x' minutes in your test, then your good to go.

bogdangherca avatar May 09 '13 13:05 bogdangherca

These (here and https://github.com/locustio/locust/issues/78#issuecomment-18788442) issues are similar and or different. Should they be merged?

nmccready avatar Jun 04 '13 15:06 nmccready

Although both of us want is for the same purpose, I want it to be as a command line option so that the execution can be automated where as the other person wants it on the web page.

uday-rayala avatar Jun 05 '13 04:06 uday-rayala

Resolved in https://github.com/locustio/locust/pull/656

aldenpeterson-wf avatar Mar 30 '18 14:03 aldenpeterson-wf