Skip to content

Tolerate PyPy's SSLError("Broken pipe") in the SSL echo server's unwrap - #3556

Merged
Zac-HD merged 1 commit into
python-trio:mainfrom
Zac-HD:claude/pypy-ssl-broken-pipe
Oct 23, 2026
Merged

Zac-HD merged 1 commit into
python-trio:mainfrom
Zac-HD:claude/pypy-ssl-broken-pipe

Conversation

@Zac-HD

@Zac-HD Zac-HD commented Oct 23, 2026

Copy link
Copy Markdown
Member

ssl_echo_serve_sync suppresses BrokenPipeError from unwrap() when the client has already gone away, but PyPy's _cffi_ssl reports that same EPIPE as a plain ssl.SSLError("Broken pipe"), so test_send_all_empty_string flakes on PyPy (seen on #3554). This tolerates that case too; any other SSLError still propagates.

The test echo server suppresses BrokenPipeError when the client has
already gone away before the server's unwrap(). PyPy's _cffi_ssl
reports that same EPIPE as a plain ssl.SSLError("Broken pipe"), so
test_send_all_empty_string flaked on PyPy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VPZoDDtuKy1bbLLR2nsnmW
@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00000%. Comparing base (4630d02) to head (20a28ac).

Additional details and impacted files
@@               Coverage Diff               @@
##                 main        #3556   +/-   ##
===============================================
  Coverage   100.00000%   100.00000%           
===============================================
  Files             128          128           
  Lines           19474        19475    +1     
  Branches         1323         1323           
===============================================
+ Hits            19474        19475    +1     
Files with missing lines Coverage Δ
src/trio/_tests/test_ssl.py 100.00000% <100.00000%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Zac-HD
Zac-HD merged commit 654ba84 into python-trio:main Oct 23, 2026
50 checks passed
@Zac-HD
Zac-HD deleted the claude/pypy-ssl-broken-pipe branch October 23, 2026 01:08
@CoolCat467

Copy link
Copy Markdown
Member

Could this not have been another suppress?

@A5rocks

A5rocks commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

^ + I'm not sure this is actually addressing the root cause, I made a repro in pypy/pypy#5664 which doesn't explicitly suppress BrokenPipeError yet passes 100% of the time on CPython and PyPy 8.0.0, but fails sometimes on PyPy 8.0.1.

But I mean this definitely works, all the extra work can be done in a follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants