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

Fix and add test for when locusts fail to exit at end of iteration during stop timeout. #1127

Merged
merged 4 commits into from
Oct 31, 2019
Merged

Conversation

cyberw
Copy link
Collaborator

@cyberw cyberw commented Oct 30, 2019

I discovered a bug introduced in the last commit on stop-timeout. Adding a test case for it (and once you have seen that it actually fails), I will revert that commit to show that it now works :)

@cyberw cyberw changed the title Add test for when locusts dont actually exit at end of iteration during stop timeout. Add test for when locusts fail to exit at end of iteration during stop timeout. Oct 30, 2019
@codecov
Copy link

codecov bot commented Oct 30, 2019

Codecov Report

Merging #1127 into master will increase coverage by 0.16%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1127      +/-   ##
==========================================
+ Coverage   74.58%   74.75%   +0.16%     
==========================================
  Files          18       18              
  Lines        1802     1806       +4     
  Branches      269      271       +2     
==========================================
+ Hits         1344     1350       +6     
+ Misses        394      389       -5     
- Partials       64       67       +3
Impacted Files Coverage Δ
locust/core.py 85.21% <0%> (-1.51%) ⬇️
locust/stats.py 82.04% <0%> (ø) ⬆️
locust/clients.py 91.48% <0%> (ø) ⬆️
locust/runners.py 64.48% <0%> (+1.63%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c84591...b5c808b. Read the comment docs.

@heyman
Copy link
Member

heyman commented Oct 30, 2019

Ah, I see, my bad! Could we move the check from the wait() method to immediately after self.execute_next_task() instead?

@cyberw
Copy link
Collaborator Author

cyberw commented Oct 31, 2019

Ah, I see, my bad! Could we move the check from the wait() method to immediately after self.execute_next_task() instead?

You mean after line 365? That doesnt work, because it wont be called on interrupts.

@cyberw cyberw changed the title Add test for when locusts fail to exit at end of iteration during stop timeout. Fix and add test for when locusts fail to exit at end of iteration during stop timeout. Oct 31, 2019
@cyberw
Copy link
Collaborator Author

cyberw commented Oct 31, 2019

Ah, I see, my bad! Could we move the check from the wait() method to immediately after self.execute_next_task() instead?

You mean after line 365? That doesnt work, because it wont be called on interrupts.

Wait, I get it now, you meant move the other check. Yes, that works, and arguably makes more sense. Commiting it now...

@heyman
Copy link
Member

heyman commented Oct 31, 2019

Hmm, I guess we also need to to do the check before execute_next_task for the case when the stop happens while the TaskSet is executing on_start (otherwise it will execute another task before stopping).

@cyberw
Copy link
Collaborator Author

cyberw commented Oct 31, 2019

Always running one iteration when using stop-timeout should be fine imo (maybe even desirable). I can definitely add it, but personally I dont think it is worth bloating the code.

@heyman
Copy link
Member

heyman commented Oct 31, 2019

Yes, it does bloat the code a bit, but I do think we should do it. A test case for it would probably also be good, to make sure we don't get a regression at some point in the future.

…on of the task if the test is stopped during setup.
@heyman
Copy link
Member

heyman commented Oct 31, 2019

Nice! LGTM?

@cyberw cyberw merged commit dd549f6 into locustio:master Oct 31, 2019
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

Successfully merging this pull request may close these issues.

2 participants