-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-119727: Add --single-process option to regrtest #119728
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
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.
Alternative names are --singleprocess
and --no-multiprocess
, which more accurately describe the effect, but this is up to you.
I think that the implementation can be simplified by reusing the same destination variable. It is more common in such cases.
Lib/test/libregrtest/cmdline.py
Outdated
@@ -307,6 +308,10 @@ def _create_parser(): | |||
group.add_argument('-j', '--multiprocess', metavar='PROCESSES', | |||
dest='use_mp', type=int, | |||
help='run PROCESSES processes at once') | |||
group.add_argument('--sequentially', action='store_true', |
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.
You can also implement it as action='store_const', dest='use_mp', const=None
.
NEED_TTY = set(''' | ||
test_ioctl | ||
'''.split()) | ||
NEED_TTY = { |
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.
Not related.
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.
Yeah, it's a follow-up of a previous PR. I didn't want to write a dedicated PR for that.
My first thought is to use something like
This is similar to pytest-xdist ( |
Currently, -j1 runs tests sequentially but spawn a new process for each test file: see #119727 (comment). I'm open to consider changing this behavior. |
Do you think anyone will realistically want to run sequentially and spawn a new process for each? My guess is not. |
I'm a little bit worried that some projects currently run tests with According to the discussion, the least bad choice is |
Then I'd include a hyphen for readability/accessibility: We have a mixture of options with and without hyphens, so consistency isn't a problem :) |
I updated the PR to use |
It does not really matter. It was just a tiny nitpick from my side. Use the name that you like if you are sure that it will not create problems in future. |
Misc/NEWS.d/next/Tests/2024-05-29-15-28-08.gh-issue-119727.dVkaZM.rst
Outdated
Show resolved
Hide resolved
…aZM.rst Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, @vstinner, I could not cleanly backport this to
|
I'll submit a backport of this because it would be useful for the iOS and Android buildbots – #122992 (comment). |
(cherry picked from commit 4e8aa32)
GH-123010 is a backport of this pull request to the 3.13 branch. |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, @vstinner, I could not cleanly backport this to
|
…onGH-119728) (cherry picked from commit 4e8aa32) Co-authored-by: Victor Stinner <vstinner@python.org>
GH-130359 is a backport of this pull request to the 3.12 branch. |
--single-process
option to regrtest to always run tests sequentially (ignore-jN
option) #119727