-
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
Add explicit 'logical' choice to --numprocesses flag #646
Add explicit 'logical' choice to --numprocesses flag #646
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for the PR!
Sorry a lot for taking so long, we seem to have missed the notifications on this one.
Please take a look at my comment. 👍
Also, please rebase on the latest master
.
This can significantly speed up runs when testing is not CPU-bound.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @kroeschl!
@nicoddemus is this going to be released soon? I am attempting to use this for a project. |
missed this one, thanks for the poke, next release will have it |
Thanks @RonnyPfannschmidt! Do you know when that next release will be? |
@joshua-s the 2 items i have to complete is full support for git archives (including non-tag archives for git >=2.32) and enhancemens of the errors when using bad pip/setuptools for modern setuptools_scm |
hmm, #tfw when you respond for the wrong project, definitively time for a weekend @nicoddemus should we do one early next week |
Sounds good to me. Would you like to do it, or want me to do it? |
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [pytest-xdist](https://togithub.com/pytest-dev/pytest-xdist) | `==2.2.1` -> `==2.3.0` | [![age](https://badges.renovateapi.com/packages/pypi/pytest-xdist/2.3.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/pytest-xdist/2.3.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/pytest-xdist/2.3.0/compatibility-slim/2.2.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/pytest-xdist/2.3.0/confidence-slim/2.2.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>pytest-dev/pytest-xdist</summary> ### [`v2.3.0`](https://togithub.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst#pytest-xdist-230-2021-06-16) [Compare Source](https://togithub.com/pytest-dev/pytest-xdist/compare/v2.2.1...v2.3.0) \=============================== ## Deprecations and Removals - `#​654 <https://github.com/pytest-dev/pytest-xdist/issues/654>`\_: Python 3.5 is no longer supported. ## Features - `#​646 <https://github.com/pytest-dev/pytest-xdist/issues/646>`\_: Add `--numprocesses=logical` flag, which automatically uses the number of logical CPUs available, instead of physical CPUs with `auto`. This is very useful for test suites which are not CPU-bound. - `#​650 <https://github.com/pytest-dev/pytest-xdist/issues/650>`\_: Added new `pytest_handlecrashitem` hook to allow handling and rescheduling crashed items. ## Bug Fixes - `#​421 <https://github.com/pytest-dev/pytest-xdist/issues/421>`\_: Copy the parent process sys.path into local workers, to work around execnet's python -c adding the current directory to sys.path. - `#​638 <https://github.com/pytest-dev/pytest-xdist/issues/638>`\_: Fix issue caused by changing the branch name of the pytest repository. ## Trivial Changes - `#​592 <https://github.com/pytest-dev/pytest-xdist/issues/592>`\_: Replace master with controller where ever possible. - `#​643 <https://github.com/pytest-dev/pytest-xdist/issues/643>`\_: Use 'main' to refer to pytest default branch in tox env names. </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/GoogleCloudPlatform/python-docs-samples).
With the change to physical CPU count in #560, test sets that are run with
psutil
installed and that are not CPU-bound (in my case, with lots of network activity) take roughly twice as long to execute on hyperthreaded CPUs. Add a new choicelogical
for flag--numprocesses
for use cases like this.This implementation is a bit weird because of the multiple fallback paths in
pytest_xdist_auto_num_workers()
which all return the logical CPU count already, but I don't see a better option.Testing:
tox
against all butpython3.5
on Linux:--numprocesses logical
on my six-core hyperthreaded CPU.