Skip to content

gh-148508: Add resilience to SSL preauth tests on iOS#148536

Merged
freakboy3742 merged 1 commit intopython:mainfrom
freakboy3742:ios-ssl-fix
Apr 14, 2026
Merged

gh-148508: Add resilience to SSL preauth tests on iOS#148536
freakboy3742 merged 1 commit intopython:mainfrom
freakboy3742:ios-ssl-fix

Conversation

@freakboy3742
Copy link
Copy Markdown
Contributor

@freakboy3742 freakboy3742 commented Apr 14, 2026

The test_ssl.TestPreHandshakeClose.test_preauth_data_to_tls_server test fails intermittently on the iOS buildbot because an SSL error doesn't raise the expected TLS handshake error.

This test already has an escape clause that allows a skip under certain error conditions (raising a ConnectionError, an OSError, or an SSL error with "wrong version number"). Running locally, I reliably hit the OSError handling case; the buildbot also hits the OSError case most of the time, but sometimes it raises SSLError with "[SSL: RECORD_LAYER_FAILURE] record layer failure".

This adds a check for "record layer failure" as an additional failure mode that will be accepted.

@freakboy3742
Copy link
Copy Markdown
Contributor Author

Tagging @vstinner for review on this since you added the "non_linux_skip_if_other_okay_error" handling.

@freakboy3742
Copy link
Copy Markdown
Contributor Author

!buildbot iOS

@bedevere-bot
Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit 37b278f 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F148536%2Fmerge

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

The builders matched are:

  • iOS ARM64 Simulator PR

Copy link
Copy Markdown
Member

@gpshead gpshead left a comment

Choose a reason for hiding this comment

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

could use a (a|b) regex instead, works either way. this is readable.

@freakboy3742 freakboy3742 merged commit c40e8b0 into python:main Apr 14, 2026
64 checks passed
@freakboy3742 freakboy3742 deleted the ios-ssl-fix branch April 14, 2026 03:12
@miss-islington-app
Copy link
Copy Markdown

Thanks @freakboy3742 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 14, 2026
…-148536)

Adds handling for a test case seen in the iOS SSL tests where an SSL connection fails to
handshake correctly.
(cherry picked from commit c40e8b0)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 14, 2026

GH-148539 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Apr 14, 2026
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 14, 2026
…-148536)

Adds handling for a test case seen in the iOS SSL tests where an SSL connection fails to
handshake correctly.
(cherry picked from commit c40e8b0)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 14, 2026

GH-148540 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 Apr 14, 2026
freakboy3742 added a commit that referenced this pull request Apr 14, 2026
…) (#148540)

Adds handling for a test case seen in the iOS SSL tests where an SSL connection fails to
handshake correctly.
(cherry picked from commit c40e8b0)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
freakboy3742 added a commit that referenced this pull request Apr 14, 2026
…) (#148539)

Adds handling for a test case seen in the iOS SSL tests where an SSL connection fails to
handshake correctly.
(cherry picked from commit c40e8b0)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
@vstinner
Copy link
Copy Markdown
Member

Tagging @vstinner for review on this since you added the "non_linux_skip_if_other_okay_error" handling.

I only made a small change to break reference cycles. non_linux_skip_if_other_okay_error() was added by @ambv with the commit 0cb0c23.

This function is quite complicated. I don't understand well why OpenSSL behaves so differently depending on the platform. I'm glad that @gpshead reviewed this change :-)

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.

4 participants