8000 bpo-43921: Debug test_ssl failures on Windows by vstinner · Pull Request #26501 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-43921: Debug test_ssl failures on Windows #26501

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions Lib/test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3194,10 +3194,14 @@ def test_wrong_cert_tls13(self):
# TLS 1.3 perform client cert exchange after handshake
s.connect((HOST, server.port))
try:
s.write(b'data')
s.read(1000)
s.write(b'should have failed already')
s.read(1000)
written = s.write(b'data')
print("write1", written)
data = s.read(1000)
print("recv1", len(data))
written = s.write(b'should have failed already')
print("write2", written)
data = s.read(1000)
print("recv2", len(data))
except ssl.SSLError as e:
if support.verbose:
sys.stdout.write("\nSSLError is %r\n" % e)
Expand All @@ -3207,13 +3211,7 @@ def test_wrong_cert_tls13(self):
if support.verbose:
sys.stdout.write("\nsocket.error is %r\n" % e)
else:
if sys.platform == "win32":
self.skipTest(
"Ignoring failed test_wrong_cert_tls13 test case. "
"The test is flaky on Windows, see bpo-43921."
)
else:
self.fail("Use of invalid cert should have failed!")
self.fail("Use of invalid cert should have failed!")

< 9B99 span class='blob-code-inner blob-code-marker ' data-code-marker=" "> def test_rude_shutdown(self):
"""A brutal shutdown of an SSL server should raise an OSError
Expand Down
2 changes: 1 addition & 1 deletion Lib/unittest/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def _exc_info_to_string(self, err, test):


def _is_relevant_tb_level(self, tb):
return '__unittest' in tb.tb_frame.f_globals
return '__unittest' in (tb.tb_frame.f_globals or {})

def _count_relevant_tb_levels(self, tb):
length = 0
Expand Down
0