Skip to content
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

gh-112334: Regression test that vfork is used when expected. #112734

Merged
merged 11 commits into from
Dec 9, 2023

Conversation

gpshead
Copy link
Member

@gpshead gpshead commented Dec 4, 2023

Adds a regression test #112334. This is the regression test I was pondering in #112617.

This also ensures strace is present in our CI GH (It may have already been there, ubuntu-standard includes it, now we're explicit about the need). I also made sure to install it on some Linux buildbots that I maintain. From my testing, some clearly do not have it.

If this test ever proves a challenge to maintain, further restricting it to a specific platform is fine. The way it works depends on details that can vary between different Linux platforms. ex: aarch64 uses more modern syscalls than x86_64 for the same task.

@gpshead gpshead added tests Tests in the Lib/test dir needs backport to 3.12 bug and security fixes labels Dec 4, 2023
@gpshead gpshead self-assigned this Dec 4, 2023
@gpshead gpshead added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 5, 2023
@bedevere-bot

This comment was marked as outdated.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 5, 2023
@gpshead

This comment was marked as outdated.

@bedevere-bot

This comment was marked as outdated.

@gpshead

This comment was marked as outdated.

@bedevere-bot

This comment was marked as outdated.

@gpshead gpshead added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 5, 2023
@bedevere-bot

This comment was marked as outdated.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 5, 2023
@gpshead

This comment was marked as outdated.

@bedevere-bot

This comment was marked as outdated.

@gpshead

This comment was marked as outdated.

@bedevere-bot

This comment was marked as outdated.

@gpshead gpshead added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 6, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @gpshead for commit a737bd3 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 6, 2023
@gpshead gpshead marked this pull request as ready for review December 6, 2023 00:59
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Lib/test/support/script_helper.py Outdated Show resolved Hide resolved
Lib/test/test_subprocess.py Outdated Show resolved Hide resolved
Lib/test/test_subprocess.py Outdated Show resolved Hide resolved
This makes output easier to understand if debugging a failure.  (removes
execve which shows up for the initial process launch by strace on _some_
platforms, adds clone2 which claims to only be used on an obsolete
architecture but if it cropped up again for some future reason would be
annoying to have break the test)
@gpshead gpshead enabled auto-merge (squash) December 9, 2023 00:14
@gpshead gpshead merged commit 10e9bb1 into python:main Dec 9, 2023
29 checks passed
@gpshead gpshead deleted the test/subprocess/112334 branch December 9, 2023 00:23
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…ython#112734)

Regression test that vfork is used when expected by subprocess.

This is written integration test style, it uses strace if it is present and appears to work to find out what system call actually gets used in different scenarios.

Test coverage is added for the default behavior and that of each of the specific arguments that must disable the use of vfork.  obviously not an entire test matrix, but it covers the most important aspects.

If there are ever issues with this test being flaky or failing on new platforms, rather than try and adapt it for all possible platforms, feel free to narrow the range it gets tested on when appropriate. That is not likely to reduce coverage.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…ython#112734)

Regression test that vfork is used when expected by subprocess.

This is written integration test style, it uses strace if it is present and appears to work to find out what system call actually gets used in different scenarios.

Test coverage is added for the default behavior and that of each of the specific arguments that must disable the use of vfork.  obviously not an entire test matrix, but it covers the most important aspects.

If there are ever issues with this test being flaky or failing on new platforms, rather than try and adapt it for all possible platforms, feel free to narrow the range it gets tested on when appropriate. That is not likely to reduce coverage.
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants