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

SequentialTaskSet: Allow weighted tasks and dict in .tasks #2742

Merged

Conversation

bakhtos
Copy link
Contributor

@bakhtos bakhtos commented May 27, 2024

Fixes #2739
Fixes #2740

As explained in respective issues,SequentialTaskSet now allows task repetition if tasks is a dictionary with weight, and itertools.cycle is used to iterate over tasks in a cycle.

So far only a draft of backend changes.

Let me know if changes are OK and then I will update also tests and docs.

@bakhtos bakhtos changed the title Feature/sequential task set optimize Optimize SequentialTaskSet May 27, 2024
@cyberw
Copy link
Collaborator

cyberw commented May 27, 2024

Looks good to me, apart from the import sorting. Run ruff and/or install pre-commit hook (https://pre-commit.com/) to make formatting/checks happen automatically on commit!

I dont use SequentialTaskSets personally, so if there's an issue in the future I might ping you :)

@bakhtos
Copy link
Contributor Author

bakhtos commented May 29, 2024

@cyberw Okay, I will fix the build shortly. Another question, though - should I add tests for the tasks being a dictionary in SequentialTaskSet?

@cyberw
Copy link
Collaborator

cyberw commented May 29, 2024

@cyberw Okay, I will fix the build shortly. Another question, though - should I add tests for the tasks being a dictionary in SequentialTaskSet?

Yes, I think that would be nice!

@bakhtos bakhtos force-pushed the feature/sequential_task_set_optimize branch from 708679c to 76b5497 Compare June 6, 2024 22:06
@cyberw
Copy link
Collaborator

cyberw commented Jul 1, 2024

Hi @bakhtos ! Are we ready to take this out of draft status? Maybe once you’ve updated the docs?

@bakhtos bakhtos marked this pull request as ready for review July 1, 2024 15:28
@bakhtos
Copy link
Contributor Author

bakhtos commented Jul 1, 2024

@cyberw Turned out few modifications to the documentation were necessary, this is now ready

@cyberw cyberw merged commit 34defec into locustio:master Jul 1, 2024
14 checks passed
@cyberw cyberw changed the title Optimize SequentialTaskSet SequentialTaskSet: Allow weighted tasks and dict in .tasks Jul 1, 2024
@cyberw
Copy link
Collaborator

cyberw commented Jul 1, 2024

Is the updated PR name ok with you?

@bakhtos bakhtos deleted the feature/sequential_task_set_optimize branch July 2, 2024 18:45
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.

Use itertools.cycle in SequentialTaskSet SequentialTaskSet handles task weights in an inconsistent way
2 participants