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-122133: Rework pure Python socketpair tests to avoid use of importlib.reload. #122493

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

freakboy3742
Copy link
Contributor

@freakboy3742 freakboy3742 commented Jul 31, 2024

#122134 introduced a small change to the operation of the pure-Python socket.socketpair() method, and added a test for that method. However, the test used importlib.reload, which is problematic because there are methods that include import-time binding of symbols like _GLOBAL_DEFAULT_TIMEOUT as default arguments.

This manifested as test failures and a test lockup on iOS, but it would likely be possible to manifest similar problems on other platforms.

This PR modifies the socket module so that the pure Python fallback method is always defined, and is monkey patched into place for the pure python test, rather than performing a module reload.

Tagged for backport to all releases back to 3.8 because #122134 was back ported to all releases.

@freakboy3742
Copy link
Contributor Author

!buildbot iOS

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit 02112a0 🤖

The command will test the builders whose names match following regular expression: iOS

The builders matched are:

  • iOS ARM64 Simulator PR

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

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

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 Jul 31, 2024
@Yhg1s Yhg1s merged commit f071f01 into python:main Jul 31, 2024
80 of 86 checks passed
@miss-islington-app
Copy link

Thanks @freakboy3742 for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 31, 2024
…importlib.reload. (pythonGH-122493)

(cherry picked from commit f071f01)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 31, 2024
…importlib.reload. (pythonGH-122493)

(cherry picked from commit f071f01)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
@bedevere-app
Copy link

bedevere-app bot commented Jul 31, 2024

GH-122504 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jul 31, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 31, 2024
…importlib.reload. (pythonGH-122493)

(cherry picked from commit f071f01)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
@bedevere-app
Copy link

bedevere-app bot commented Jul 31, 2024

GH-122505 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Jul 31, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 31, 2024
…importlib.reload. (pythonGH-122493)

(cherry picked from commit f071f01)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
@bedevere-app
Copy link

bedevere-app bot commented Jul 31, 2024

GH-122506 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Jul 31, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 31, 2024
…importlib.reload. (pythonGH-122493)

(cherry picked from commit f071f01)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
@bedevere-app
Copy link

bedevere-app bot commented Jul 31, 2024

GH-122507 is a backport of this pull request to the 3.10 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.10 only security fixes label Jul 31, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 31, 2024
…importlib.reload. (pythonGH-122493)

(cherry picked from commit f071f01)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
@bedevere-app
Copy link

bedevere-app bot commented Jul 31, 2024

GH-122508 is a backport of this pull request to the 3.9 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.9 only security fixes label Jul 31, 2024
@bedevere-app
Copy link

bedevere-app bot commented Jul 31, 2024

GH-122509 is a backport of this pull request to the 3.8 branch.

Yhg1s pushed a commit that referenced this pull request Jul 31, 2024
… importlib.reload. (GH-122493) (#122504)

gh-122133: Rework pure Python socketpair tests to avoid use of importlib.reload. (GH-122493)

(cherry picked from commit f071f01)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gpshead added a commit that referenced this pull request Jul 31, 2024
… importlib.reload. (GH-122493) (GH-122505)

gh-122133: Rework pure Python socketpair tests to avoid use of importlib.reload. (GH-122493)

(cherry picked from commit f071f01)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
@freakboy3742 freakboy3742 deleted the socket-noreload branch July 31, 2024 21:41
ambv pushed a commit that referenced this pull request Aug 2, 2024
… importlib.reload. (GH-122493) (GH-122506)

(cherry picked from commit f071f01)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
ambv pushed a commit that referenced this pull request Aug 2, 2024
… importlib.reload. (GH-122493) (GH-122507)

(cherry picked from commit f071f01)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
ambv pushed a commit that referenced this pull request Aug 2, 2024
…importlib.reload. (GH-122493) (GH-122508)

(cherry picked from commit f071f01)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
ambv pushed a commit that referenced this pull request Aug 2, 2024
…importlib.reload. (GH-122493) (GH-122509)

(cherry picked from commit f071f01)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
…importlib.reload. (python#122493)


Co-authored-by: Gregory P. Smith <greg@krypto.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants