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

Add --maxschedchunk CLI option #857

Merged
merged 2 commits into from
Dec 23, 2022

Conversation

amezin
Copy link
Collaborator

@amezin amezin commented Dec 20, 2022

Maximum number of tests scheduled in one step.

Setting it to 1 will force pytest to send tests to workers one by one - might be useful for a small number of slow tests.

Larger numbers will allow the scheduler to submit consecutive chunks of tests to workers - allows reusing fixtures.

Unlimited if not set.

Fixes #855
Fixes #255

@amezin amezin force-pushed the limit-sched-chunk-size branch from 0c23da7 to de012b9 Compare December 20, 2022 01:51
Maximum number of tests scheduled in one step.

Setting it to 1 will force pytest to send tests to workers one by one -
might be useful for a small number of slow tests.

Larger numbers will allow the scheduler to submit consecutive chunks of tests
to workers - allows reusing fixtures.

Unlimited if not set.

Fixes pytest-dev#855
@amezin amezin force-pushed the limit-sched-chunk-size branch from 1b0ebc7 to 8a7ef66 Compare December 20, 2022 01:54
@amezin
Copy link
Collaborator Author

amezin commented Dec 20, 2022

While this solves #855, it's an ugly workaround IMO.

The more I look at the scheduling problem, the more I think it should be solved using work stealing https://en.wikipedia.org/wiki/Work_stealing. Described in detail in #858

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @amezin!

Please take a look at my comments. 👍

changelog/855.feature Outdated Show resolved Hide resolved
src/xdist/plugin.py Outdated Show resolved Hide resolved
src/xdist/scheduler/load.py Show resolved Hide resolved
src/xdist/scheduler/load.py Outdated Show resolved Hide resolved
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @amezin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants