-
Notifications
You must be signed in to change notification settings - Fork 230
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
Feature request: worker pool with --dist=pool
#794
Comments
From the docs, this pool behavior is actually how I was expecting |
There is a queue of tasks available for each worker, the scheduler was done with network usage in mind (10-15 years ago that was common usage by the pypy team) It's simply the case that bundling, back-pressure and testcase with long run times have been integrated There are numerous issues on the topic already |
I don't have enough context to fully follow that, although maybe you're not aiming that at me. 😆 Sorry if this is a dupe! |
I belive this is now solved by #862 and BTW, the scheduling algorithm where workers just grab tests one by one when ready, without any order, likely wouldn't be the best for fixture reuse. |
Currently, it seems
pytest-xdist
divvies up all the work to be done and then the work gets executed. This would be faster if the workers just grabbed tasks out of a pool instead of divvying at the start.Example:
Running this with
takes 11.8s because supposedly, one worker gets unlucky and gets
test_2
andtest_4
, while the other worker finishes almost immediately but then sits idle. Note: this repro may not be reliable since there's no guaranteed grouping - try shifting the functions around to repro if necessary.This is an extreme example, but I also see this in my actual codebase I work on where I see 1 worker going for a non-negligle time after others have finished.
The text was updated successfully, but these errors were encountered: