Rescue SystemCallError in the TLS test server - #107
Merged
Merged
Conversation
When the client rejects the certificate and closes the socket with part of the handshake still unread, Windows resets the connection and SSL_accept on the server thread raises Errno::ECONNRESET instead of SSLError. It escaped the thread and teardown re-raised it as a test error. https://github.com/ruby/ruby/actions/runs/36208437463/job/108309842285 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Net::TestSSLContext#test_tls_verify_true_after_initializeintermittently errors on the Windowstest-bundled-gemsjob of ruby/ruby withErrno::ECONNRESET: An existing connection was forcibly closed by the remote host. - SSL_accept. Every test that expects a verification failure shares the race.When the client rejects the certificate, it closes the socket with part of the server's handshake still unread. Windows then resets the connection and drops the client's alert, so
SSL_acceptin the server thread raisesECONNRESETinstead ofSSLError, and teardown re-raises it. I madewrap_ssl_socketrescueSystemCallErroras well.On mswin, the six verify-failure tests hit this 8 times in 24,000 runs before the change and 0 times after.
https://github.com/ruby/ruby/actions/runs/36208437463/job/108309842285
Generated with Claude Code