You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Admittedly, I'd say this particular bug is open to interpretation and I can see benefit to the current behavior.
However, I believe the current behavior is the opposite of what most implementations would require.
Describe the bug
The get_run_time() method in LoadTestShape returns the time delta relative to the start of Locust, not the start of the test.
This is exacerbated when there is a significant delay between Locust startup and test start (for example through the WebUI)
Expected behavior
LoadTestShape.get_run_time() should return roughly 0 seconds the first time LoadTestShape.tick() is called.
If the test resets (say, through the WebUI), the LoadTestShape timer should reset too.
Actual behavior
When Locust calls LoadTestShape.tick() for the first time, a call to self.get_run_time() will return a time delay that incorporates Locust startup and all time spent in the WebUI.
Restarting the example below is basically impossible as the timer has already exceeded 10 seconds if the LoadTest finished normally.
Workaround
A subclass of LoadTestShape could keep a self.first_loop = True variable then do:
Admittedly, I'd say this particular bug is open to interpretation and I can see benefit to the current behavior.
However, I believe the current behavior is the opposite of what most implementations would require.
Describe the bug
The get_run_time() method in LoadTestShape returns the time delta relative to the start of Locust, not the start of the test.
This is exacerbated when there is a significant delay between Locust startup and test start (for example through the WebUI)
Expected behavior
LoadTestShape.get_run_time() should return roughly 0 seconds the first time LoadTestShape.tick() is called.
If the test resets (say, through the WebUI), the LoadTestShape timer should reset too.
Actual behavior
When Locust calls LoadTestShape.tick() for the first time, a call to self.get_run_time() will return a time delay that incorporates Locust startup and all time spent in the WebUI.
Restarting the example below is basically impossible as the timer has already exceeded 10 seconds if the LoadTest finished normally.
Workaround
A subclass of LoadTestShape could keep a
self.first_loop = True
variable then do:Steps to reproduce
The above runs for ~10s when run with:
locust --headless
But might never run if started manually (10s later) via:
locust
Environment
The text was updated successfully, but these errors were encountered: