Skip to content

Add --single-process option to regrtest to always run tests sequentially (ignore -jN option) #119727

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

Closed
vstinner opened this issue May 29, 2024 · 5 comments
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@vstinner
Copy link
Member

vstinner commented May 29, 2024

The Python release process runs tests sequentially. It catchs some issues which are ignored silently when running tests in parallel.

I propose adding --sequentially option to regrtest to always run tests sequentially. It can be used to ignore any -jN option and also to re-run failed tests sequentially.

Linked PRs

@vstinner
Copy link
Member Author

My motivation for this change is also a desire to change the regrtest default to -j0: run tests in parallel using the number of CPU.

@Eclips4 Eclips4 added tests Tests in the Lib/test dir type-feature A feature request or enhancement labels May 29, 2024
@serhiy-storchaka
Copy link
Member

This is an opposite of --multiprocess. Why not call it --singleprocess?

You can run tests with -j1, it will be sequentially, but in different processes.

@vstinner
Copy link
Member Author

IMO "sequentially" is the right name. --multiprocess means in fact "running tests in parallel". Using multipe processes is just an implementation details. It could be threads or something else. The opposite of parallel is sequential. IMO it's too late to rename the --multiprocess option.

Note: there is already a --single option. --singleprocess sounds too close.

@serhiy-storchaka
Copy link
Member

I will not insist.

The --multiprocess option has two effects: it runs the tests in parallel and runs every test is a separate process. It could be possible to run the tests in parallel using the process pull, but this is not how it is implemented now, and I do not think there is a benefit to implement such option. Currently there are three options:

  • Run the tests sequentially in the same (main) process. By default.
  • Run the tests sequentially in separate processes. -j1.
  • Run the tests in parallel in separate processes. -jN.

@hugovk hugovk changed the title Add --sequentially option to regrtest to always run tests sequentially (ignore -jN option) Add --single-process option to regrtest to always run tests sequentially (ignore -jN option) Jun 3, 2024
vstinner added a commit to vstinner/cpython that referenced this issue Jun 13, 2024
Python test runner (regrtest) now runs tests in parallel by default.
Use the --single-process option to run tests sequentially in a single
process.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 13, 2024
Python test runner (regrtest) now runs tests in parallel by default.
Use the --single-process option to run tests sequentially in a single
process.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 13, 2024
The Python test runner (regrtest) now runs tests in parallel by
default.  Use the --single-process option to run tests sequentially
in a single process.
@vstinner
Copy link
Member Author

Implemented by change 4e8aa32.

noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
mhsmith pushed a commit to mhsmith/cpython that referenced this issue Aug 14, 2024
vstinner added a commit that referenced this issue Aug 26, 2024
…123010)

gh-119727: Add --single-process option to regrtest (#119728)

(cherry picked from commit 4e8aa32)

Co-authored-by: Victor Stinner <[email protected]>
hugovk pushed a commit to hugovk/cpython that referenced this issue Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants