Skip to content

gh-87868: Skip some test in test_subprocess if python is configured with --enable-shared - #113867

Merged
gpshead merged 5 commits into
python:mainfrom
aisk:improve_test_one_environment_variable
Jan 10, 2024
Merged

gh-87868: Skip some test in test_subprocess if python is configured with --enable-shared#113867
gpshead merged 5 commits into
python:mainfrom
aisk:improve_test_one_environment_variable

Conversation

@aisk

@aiskaisk commented Jan 9, 2024

Copy link
Copy Markdown
Member

@aisk
aisk requested a review from gpshead as a code ownerJanuary 9, 2024 16:42
@bedevere-appbedevere-appBot added tests Tests in the Lib/test dir awaiting review labels Jan 9, 2024
@aiskaisk changed the title gh-102731: improve the assert for test_one_environment_variablegh-87868: improve the assert for test_one_environment_variableJan 9, 2024
@erlend-aasland

Copy link
Copy Markdown
Contributor

Can you update the PR title to more accurately reflect the change?

@aiskaisk changed the title gh-87868: improve the assert for test_one_environment_variablegh-87868: use assertEqual rather than assertTrue in test_subprocess.test_one_environment_variableJan 9, 2024
@erlend-aaslanderlend-aasland added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jan 9, 2024
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit 4f22675 🤖

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

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jan 9, 2024
@aisk

aisk commented Jan 9, 2024

Copy link
Copy Markdown
MemberAuthor

How about this?

@aisk

aisk commented Jan 9, 2024

Copy link
Copy Markdown
MemberAuthor

I was thinking that perhaps we could determine the PR title later, if we addressed the issue, and fixed it in this PR.

@erlend-aasland

Copy link
Copy Markdown
Contributor

How about this?

Instead of describing the git diff, I would try to write the PR title so it reflects the change in behaviour. For example, a PR can fix a flakey test by making the test environment deterministic. If you are scrolling through the git log it is more helpful to read about what effect a commit had. We can always check the diff by doing git log -p :)

@zooba

zooba commented Jan 9, 2024

Copy link
Copy Markdown
Member

I wouldn't expect this to fix it, btw. It's just going to improve the output when it fails. So we can review the buildbot results with this change and figure out the actual fix, and then do that as part of this PR (which will then need a different title)

@aisk

aisk commented Jan 9, 2024

Copy link
Copy Markdown
MemberAuthor

Instead of describing the git diff, I would try to write the PR title so it reflects the change in behaviour. For example, a PR can fix a flakey test by making the test environment deterministic. If you are scrolling through the git log it is more helpful to read about what effect a commit had. We can always check the diff by doing git log -p :)

Really thanks! I've learnt a lot from this.

Comment threadLib/test/test_subprocess.py Outdated
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
@aiskaisk changed the title gh-87868: use assertEqual rather than assertTrue in test_subprocess.test_one_environment_variablegh-87868: Improve the test output for test_subprocessJan 9, 2024
@erlend-aasland

This comment was marked as off-topic.

@aisk

aisk commented Jan 9, 2024

Copy link
Copy Markdown
MemberAuthor

The failed test environment is Linux based, like https://buildbot.python.org/all/#/builders/543/builds/5159 .

@erlend-aasland

This comment was marked as outdated.

@bedevere-bot

This comment was marked as off-topic.

@erlend-aasland

Copy link
Copy Markdown
Contributor

The failed test environment is Linux based, like https://buildbot.python.org/all/#/builders/543/builds/5159 .

You are right; I assumed it was Windows-specific, since the previous PR was Windows oriented.

@erlend-aasland

This comment was marked as outdated.

@bedevere-bot

This comment was marked as outdated.

Comment threadLib/test/test_subprocess.py Outdated
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
@aiskaisk changed the title gh-87868: Improve the test output for test_subprocessgh-87868: Skip some test in test_subprocess if python is configured with --enable-sharedJan 10, 2024
@erlend-aasland

This comment was marked as outdated.

@bedevere-bot

This comment was marked as outdated.

@aisk

aisk commented Jan 10, 2024

Copy link
Copy Markdown
MemberAuthor

Sorry,I updated it again, the AddressSanitizer` should be skipped also.

@erlend-aasland

Copy link
Copy Markdown
Contributor

!buildbot .64 (RHEL|Fedora Stable).

@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit 5671246 🤖

The command will test the builders whose names match following regular expression: .*64 (RHEL|Fedora Stable).*

The builders matched are:

  • AMD64 RHEL8 PR
  • aarch64 RHEL8 LTO + PGO PR
  • aarch64 Fedora Stable LTO PR
  • AMD64 RHEL7 LTO PR
  • AMD64 RHEL8 Refleaks PR
  • AMD64 RHEL8 LTO PR
  • AMD64 Fedora Stable Refleaks PR
  • AMD64 RHEL8 FIPS No Builtin Hashes PR
  • aarch64 RHEL8 PR
  • AMD64 Fedora Stable Clang PR
  • aarch64 Fedora Stable Refleaks PR
  • AMD64 Fedora Stable LTO + PGO PR
  • aarch64 RHEL8 Refleaks PR
  • AMD64 RHEL7 PR
  • aarch64 RHEL8 LTO PR
  • AMD64 Fedora Stable LTO PR
  • AMD64 RHEL7 LTO + PGO PR
  • aarch64 Fedora Stable Clang Installed PR
  • aarch64 Fedora Stable PR
  • AMD64 Fedora Stable PR
  • aarch64 Fedora Stable LTO + PGO PR
  • AMD64 RHEL7 Refleaks PR
  • aarch64 Fedora Stable Clang PR
  • AMD64 RHEL8 FIPS Only Blake2 Builtin Hash PR
  • AMD64 RHEL8 LTO + PGO PR
  • AMD64 Fedora Stable Clang Installed PR

@zooba

Copy link
Copy Markdown
Member

We should also be able to run the test by copying os.environ into the env dict and then adding our own keys, right? That's what I always end up doing to make sure things launch on Windows (would be nice if it was built in... but too late there)

@aisk

aisk commented Jan 10, 2024

Copy link
Copy Markdown
MemberAuthor

The main intent of this test is to determine if we correctly handle the off-by-one problems in the for loops within the sort and de-duplication functions. For example, do we missed something if there is just one element in the environment keys. Therefore I think we can't copy the os.environ in the test.

@gpsheadgpshead added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Jan 10, 2024
@gpshead
gpshead merged commit fafb327 into python:mainJan 10, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @aisk for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @aisk and @gpshead, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker fafb3275f25e116e51ff0b867aec597cb3de840f 3.12

@miss-islington-app

Copy link
Copy Markdown

Sorry, @aisk and @gpshead, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker fafb3275f25e116e51ff0b867aec597cb3de840f 3.11

@gpshead

Copy link
Copy Markdown
Member

oh, backports do not appear to be needed. yay.

@gpshead

Copy link
Copy Markdown
Member

thanks for the fix! this test is indeed somewhat fragile and only easy to run on some platforms - skipping it when it cannot be run is fine. we've still got coverage elsewhere.

gpshead pushed a commit to miss-islington/cpython that referenced this pull request Jan 10, 2024
…ess` when the platform or build cannot do that (python#113867)
* improve the assert for test_one_environment_variable
* skip some test in test_subprocess when python is configured with shared
* also skip the test if AddressSanitizer is enabled
---------
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
gpshead pushed a commit to miss-islington/cpython that referenced this pull request Jan 10, 2024
…ess` when the platform or build cannot do that (python#113867)
* improve the assert for test_one_environment_variable
* skip some test in test_subprocess when python is configured with shared
* also skip the test if AddressSanitizer is enabled
---------
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
@aisk
aisk deleted the improve_test_one_environment_variable branch January 16, 2024 10:14
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
…ess` when the platform or build cannot do that (python#113867)
* improve the assert for test_one_environment_variable
* skip some test in test_subprocess when python is configured with shared
* also skip the test if AddressSanitizer is enabled
---------
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
aisk added a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…ess` when the platform or build cannot do that (python#113867)
* improve the assert for test_one_environment_variable
* skip some test in test_subprocess when python is configured with shared
* also skip the test if AddressSanitizer is enabled
---------
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…ess` when the platform or build cannot do that (python#113867)
* improve the assert for test_one_environment_variable
* skip some test in test_subprocess when python is configured with shared
* also skip the test if AddressSanitizer is enabled
---------
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@aisk@erlend-aasland@bedevere-bot@zooba@gpshead