pytest-dev / pytest-dev/pytest-xdist
Allow one test per node
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 287
- Avg merge
- 9h 30m
- Merged PRs (30d)
- 2
Description
The new --maxschedchunk option is great for running test suites with few slow tests.
However, it has a limitation in that it sends two tests to each worker at the start even if --maxschedchunk=1. If tests are sorted by how long they take, the two slowest tests will end up on the same node.
https://github.com/pytest-dev/pytest-xdist/issues/876 sounds like this is not easy to change.
Use-Case
I have a test suite with roughly this kind of runtime distribution:
15 min: 2 tests
5 min: 5 tests
0.5 min: 30 tests
The test fixtures are extremely cheap, much cheaper than the tests themselves. We know pretty well how long each test takes, and sort tests accordingly.
As a workaround, we can take into account xdist's scheduling details in the sorting of tests, but this is confusing and it would be nicer to fix it here.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the implementation and tests for the --maxschedchunk scheduler option, then review the scheduling concern in issue #876. Reproduce the case with sorted tests and --maxschedchunk=1; done means the initial scheduling places at most one test on each worker and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100