-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
--run-time argument includes test_start event duration since the upgrade to v2 #2319
Comments
Interesting. I dont remember if this was a deliberate change or an accidental one, and I'm not sure which version makes the most sense/is most expected. Probably want to leave it as is, but we could document it better. At some point there was a risk that Users got started before test_start had finished, maybe that was the behaviour in 1.x. |
This issue was closed because it has been stalled for 10 days with no activity. This does not necessarily mean that the issue is bad, but it most likely means that nobody is willing to take the time to fix it. If you have found Locust useful, then consider contributing a fix yourself! |
I'll try to fix this soon... |
Hmm. I took another swing at this, but it's really hard to do without some serious refactoring. The main function doesn't know anything about test_start, and the Runner (that calls test_start) can't stop the whole test, even if we told it about the run time, because it has no idea about things like the web UI, that need to be shut down. |
Describe the bug
The behaviour of
--run-time
argument has changed since the upgrade to v2. In later versions, it controls the total duration of the test includingtest_start
event, while in v1 it doesn't include the duration oftest_start
event.I looked through Changelog Highlights and github issues, but couldn't find any information about it.
Expected behavior
If we run a load test with
locust 1.6.0
and specify--run-time 15s
,test_start
event is executed before we set the time limit of 15s:Actual behavior
If we run a load test with
locust 2.15.1
and specify--run-time 15s
, the duration oftest_start
event is included in these 15s:Steps to reproduce
Run the specified command on locustfile.py with locust 1.6.0 and 2.15.1.
Environment
Workaround
init
event can be used instead ofon_start
event after upgrading to v2 as its duration is not included in the run time specified by--run-time
argument.The text was updated successfully, but these errors were encountered: