You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI #88395
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2132, in test_get_server_certificate
_test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA)
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2329, in _test_get_server_certificate
pem = ssl.get_server_certificate((host, port), ca_certs=cert)
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1520, in get_server_certificatewith create_connection(addr, timeout=timeout) as sock:
File "/Users/runner/work/cpython/cpython/Lib/socket.py", line 844, in create_connectionraise err
File "/Users/runner/work/cpython/cpython/Lib/socket.py", line 832, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused
The problem could be related to bpo-43921. I neither have a macOS nor a Windows machine to reproduce and debug the issue. Since I'm cannot reproduce the problem on Linux, I'm unable to debug and fix it.
$ ./python.exe -m test test_ssl -m test_get_server_certificate -u all -F
...
0:02:11 load avg: 2.10 [328] test_ssl
test test_ssl failed -- Traceback (most recent call last):
File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2132, in test_get_server_certificate
_test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA)
File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2329, in _test_get_server_certificate
pem = ssl.get_server_certificate((host, port), ca_certs=cert)
File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 1521, in get_server_certificatewith context.wrap_socket(sock, server_hostname=host) as sslsock:
File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 518, in wrap_socketreturnself.sslsocket_class._create(
File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 1070, in _createself.do_handshake()
File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 1339, in do_handshakeself._sslobj.do_handshake()
ConnectionResetError: [Errno 54] Connection reset by peer
I haven't observed this issue on the CI since GH-26893 through GH-26896 was merged. Marking this as resolved. If anyone disagrees, feel free to reopen :)
Activity
erlend-aasland commentedon May 25, 2021
See https://github.com/python/cpython/pull/26104/checks?check_run_id=2662511684
======================================================================
ERROR: test_get_server_certificate (test.test_ssl.SimpleBackgroundTests)
----------------------------------------------------------------------
[-]test_get_server_certificate fails on macOS[/-][+]test_get_server_certificate fails intermittently on macOS[/+][-]test_get_server_certificate fails on macOS[/-][+]test_get_server_certificate fails intermittently on macOS[/+]tiran commentedon May 25, 2021
The problem could be related to bpo-43921. I neither have a macOS nor a Windows machine to reproduce and debug the issue. Since I'm cannot reproduce the problem on Linux, I'm unable to debug and fix it.
pablogsal commentedon May 25, 2021
Can you maybe use a VM for Windows?
erlend-aasland commentedon May 25, 2021
I’ll see if I can provoke it on my Mac.
What’s the preferred solution?
Maybe 2. is acceptable :)
pablogsal commentedon May 25, 2021
Is possible that these are flaky tests but I am afraid this may be something more important so o would prefer to go with 3 ;)
erlend-aasland commentedon May 25, 2021
I feared that ;)
erlend-aasland commentedon May 25, 2021
Getting there. The error message is similar:
test_ssl failed
== Tests result: FAILURE ==
erlend-aasland commentedon May 25, 2021
Got it:
test_ssl failed
== Tests result: FAILURE ==
erlend-aasland commentedon May 25, 2021
test_ssl failed
== Tests result: FAILURE ==
29 remaining items
pablogsal commentedon Jun 24, 2021
New changeset b5a52ee by Erlend Egeberg Aasland in branch 'main':
bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893)
b5a52ee
miss-islington commentedon Jun 24, 2021
New changeset 0796e21 by Miss Islington (bot) in branch '3.9':
bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893)
0796e21
miss-islington commentedon Jun 24, 2021
New changeset b3fac29 by Miss Islington (bot) in branch '3.10':
bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893)
b3fac29
erlend-aasland commentedon Jun 24, 2021
Marking gh-88021 (bpo-43855) as a duplicate of this issue.
erlend-aasland commentedon Jun 24, 2021
Marking gh-88403 (bpo-44237) as a duplicate of this issue.
erlend-aasland commentedon Jun 24, 2021
FYI, here's a CI failure against 3.9:
https://github.com/python/cpython/runs/2894813367?check_suite_focus=true
pablogsal commentedon Jun 24, 2021
New changeset 71ba16b by Miss Islington (bot) in branch '3.8':
bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893) (GH-26895)
71ba16b
erlend-aasland commentedon Jun 27, 2021
I haven't observed this issue on the CI since GH-26893 through GH-26896 was merged. Marking this as resolved. If anyone disagrees, feel free to reopen :)
vstinner commentedon Jun 28, 2021
http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/ says:
"If we trigger a send while the kernel is in the middle of tearing down the socket, it returns EPROTOTYPE." (instead of ECONNRESET)
Maybe send() could raise a ConnectionResetError exception on EPROTOTYPE?
erlend-aasland commentedon Jun 28, 2021
But here, it is write() that returns EPROTOTYPE. See msg394798.
erlend-aasland commentedon Jun 28, 2021
I'd be interested in hearing Ronald's opinion. (Added to nosy.)