pytest-dev / pytest-dev/pytest-xdist
Feature request: mark number of cores consumed by a test
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 287
- Avg merge
- 9h 30m
- Merged PRs (30d)
- 2
Description
One of my workflows runs a third-party program that runs at 300-400% CPU utilization with no way to control the number of cores/threads used. When I run the workflow's test suite with pytest -n 8, eight test functions will run simultaneously. But the actual CPU utilization could be much higher depending on how many tests running this third-party program are active at the same time. I can do a bit of quick math to compensate and run fewer parallel worker processes, but then the rest of the test suite runs more slowly when that program is not being run.
If there were a way to mark the relevant test functions and say "this function consumes 4 CPUs", then it would be possible to strike the ideal balance between using all available CPUs and not overwhelming the system.
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 with the pytest -n 8 workflow and the test functions that invoke the third-party program. Define how tests declare their CPU consumption and verify that scheduling accounts for those values while keeping other tests parallel; the issue names no files or tests to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100