Add test_stopping event#2033
Merged
cyberw merged 6 commits intoMar 1, 2022
Merged
Conversation
cyberw
reviewed
Feb 25, 2022
| master = self.get_runner(user_classes=[TestUser]) | ||
|
|
||
| run_count = [0] | ||
| run_count = [0, 0] |
Collaborator
There was a problem hiding this comment.
Using a list here is more or less a hack for modifying values outside the function. I think this can be done in a more obvious way. even using a (properly named) global is preferable.
Collaborator
|
Looks good apart from my comment about the test. Can you add this event to this example? https://github.com/locustio/locust/blob/master/examples/test_data_management.py |
Contributor
Author
|
Will do |
cyberw
reviewed
Feb 28, 2022
|
|
||
|
|
||
| @events.test_stop.add_listener | ||
| @events.test_stopping.add_listener |
Collaborator
There was a problem hiding this comment.
Could you update the comment at the start of the file too!
Contributor
Author
There was a problem hiding this comment.
like this?
# 6. Test run stopping
# 7. User stop
# 8. Test run stop
# 9. (not shown in this example) Locust quit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding test_stopping event - fired before stopping users.
It resolves #2031