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

stop/interrupt weighting/logic for nested tasks that execute a single task #632

Closed
daluu opened this issue Jul 23, 2017 · 2 comments
Closed

Comments

@daluu
Copy link

daluu commented Jul 23, 2017

It's not clear from the documentation http://docs.locust.io/en/latest/writing-a-locustfile.html#tasksets-can-be-nested, maybe some elaboration would help, or another example.

Say if I wanted to have:

Main task

  • sub task 1
    • subtask 1 function
      • sub sub task A
        • sub sub task A function (when done, we want to return to subtask 1 and from there return to main task)
  • sub task 2
    • subtask 2 function
      ...

In such a setup, would sub task 1 need to include a stop function in addition to the "subtask 1 function" so that it exits back to main task? And similarly the sub sub task A needs a stop function to return to subtask 1? If so, would stop() be weighted 1 and the other task function be also weighted 1, or should task be weight 2 and stop() be weight 1 so that we always execute the task before execute stop?

Or just call self.interrupt() at the end of sub task 1, sub sub task A? So no need for separate stop task method with weighting? Or no need for interrupt when have only single task subtasks?

@cyberw
Copy link
Collaborator

cyberw commented Oct 18, 2019

Closing this due to lack of activity. I hope you solved your issue, otherwise try slack!

@cyberw cyberw closed this as completed Oct 18, 2019
@daluu
Copy link
Author

daluu commented Oct 22, 2019

Thanks for the suggestion. Just noting down the response received on slack in case others have a similar question as I:

You have to call the interrupt() somewhere for the Locust to stop executing within the current TaskSet and return to the parent. (edited)

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

No branches or pull requests

3 participants