You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Run the Python test suite in parallel by default #159155
Currently, python -m test runs tests sequentially in a single process by default. It's slow and unsafe: if a test does crash, the whole test suite is interrupted, we don't exit cleanly, and resources may not be released properly (a temporary directory can be left behind).
I propose to run the Python test suite in parallel by default: choose the number of worker processes using os.process_cpu_count(). In short, make -j0 option the default. Running tests in parallel makes the task way faster (especially on machines with 8 CPUs or more). When using -j0, the test suite main process just watchs worker processes and is way likely to crash. When a worker process does crash, its working directory is removed cleanly. Also, when tests are interrupted by CTRL+C, the main process makes sure that all worker processes are stopped or killed (including child processes).
Instead, you will have to use --single-process explicitly to opt-in for Python 3.15 behavior: run tests sequentially in a single process.
It would be nice if this picked up the make parallelism pieces when run under make test, either via MAKEFLAGS or https://www.gnu.org/software/make/manual/html_node/Job-Slots.html. Definitely can be an additional add-on feature though separate from the initial behavior change.
Activity
vstinner commentedon Oct 10, 2026
I'm working on a pull request to implement this change.
cmaloney commentedon Oct 10, 2026
It would be nice if this picked up the make parallelism pieces when run under
make test, either via MAKEFLAGS or https://www.gnu.org/software/make/manual/html_node/Job-Slots.html. Definitely can be an additional add-on feature though separate from the initial behavior change.