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
unittest: _is_relevant_tb_level() fails because tb.tb_frame.f_globals=None #88454
Comments
Sometimes, when a test fails in the main branch, unittest fails with the following error: ... I only see this error in the main branch, so I suspect that it's a recent change. Mark, Guido: can it be related to the recent optimization work? Full log: vstinner@DESKTOP-DK7VBIL C:\vstinner\python\main>python -u -m test test_ssl -u all -v -m test_pha_required_nocert -F -j5
(...)
0:00:27 load avg: 15.68 [ 47/1] test_ssl failed
test_ssl: testing with 'OpenSSL 1.1.1k 25 Mar 2021' (1, 1, 1, 11, 15)
under Windows ('10', '10.0.19043', 'SP0', 'Multiprocessor Free')
HAS_SNI = True
OP_ALL = 0x-7fffffac
OP_NO_TLSv1_1 = 0x10000000
test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ... server: new connection from ('127.0.0.1', 57613)
client cert is None
client did not provide a cert
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
TLS: (<ssl.SSLSocket fd=644, family=AF_INET, type=SOCK_STREAM, proto=0, laddr=('127.0.0.1', 57612), raddr=('127.0.0.1', 57613)>, 'write', TLSVersion.TLSv1_3, _TLSContentType.ALERT, _TLSAlertType.CERTIFICA
TE_REQUIRED, b'\x02t')
Test server failure:
Traceback (most recent call last):
File "C:\vstinner\python\main\lib\test\test_ssl.py", line 2444, in run
msg = self.read()
File "C:\vstinner\python\main\lib\test\test_ssl.py", line 2421, in read
return self.sslconn.read()
File "C:\vstinner\python\main\lib\ssl.py", line 1131, in read
return self._sslobj.read(len)
ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2522)
Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 2)
Warning -- Dangling thread: <ThreadedEchoServer(Thread-1, stopped daemon 540)>
Warning -- Dangling thread: <_MainThread(MainThread, started 1592)>
Warning -- threading._dangling was modified by test_ssl
Before: {<weakref at 0x00000235F1D3A210; to '_MainThread' at 0x00000235F0E9C730>}
After: {<weakref at 0x00000235F1D3B050; to 'ThreadedEchoServer' at 0x00000235F1687890>, <weakref at 0x00000235F1D3B2F0; to '_MainThread' at 0x00000235F0E9C730>}
test test_ssl crashed -- Traceback (most recent call last):
File "C:\vstinner\python\main\lib\test\libregrtest\runtest.py", line 282, in _runtest_inner
refleak = _runtest_inner2(ns, test_name)
File "C:\vstinner\python\main\lib\test\libregrtest\runtest.py", line 246, in _runtest_inner2
test_runner()
File "C:\vstinner\python\main\lib\test\test_ssl.py", line 5010, in test_main
support.run_unittest(*tests)
File "C:\vstinner\python\main\lib\test\support\__init__.py", line 1083, in run_unittest
_run_suite(suite)
File "C:\vstinner\python\main\lib\test\support\__init__.py", line 960, in _run_suite
result = runner.run(suite)
File "C:\vstinner\python\main\lib\unittest\runner.py", line 176, in run
test(result)
File "C:\vstinner\python\main\lib\unittest\suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "C:\vstinner\python\main\lib\unittest\suite.py", line 122, in run
test(result)
File "C:\vstinner\python\main\lib\unittest\suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "C:\vstinner\python\main\lib\unittest\suite.py", line 122, in run
test(result)
File "C:\vstinner\python\main\lib\unittest\case.py", line 652, in __call__
return self.run(*args, **kwds)
File "C:\vstinner\python\main\lib\unittest\case.py", line 600, in run
self._feedErrorsToResult(result, outcome.errors)
File "C:\vstinner\python\main\lib\unittest\case.py", line 516, in _feedErrorsToResult
result.addFailure(test, exc_info)
File "C:\vstinner\python\main\lib\test\support\testresult.py", line 123, in addFailure
super().addFailure(test, err)
File "C:\vstinner\python\main\lib\unittest\runner.py", line 75, in addFailure
super(TextTestResult, self).addFailure(test, err)
File "C:\vstinner\python\main\lib\unittest\result.py", line 17, in inner
return method(self, *args, **kw)
File "C:\vstinner\python\main\lib\unittest\result.py", line 122, in addFailure
self.failures.append((test, self._exc_info_to_string(err, test)))
File "C:\vstinner\python\main\lib\unittest\result.py", line 182, in _exc_info_to_string
length = self._count_relevant_tb_levels(tb)
File "C:\vstinner\python\main\lib\unittest\result.py", line 209, in _count_relevant_tb_levels
while tb and not self._is_relevant_tb_level(tb):
File "C:\vstinner\python\main\lib\unittest\result.py", line 205, in _is_relevant_tb_level
return '__unittest' in tb.tb_frame.f_globals
TypeError: argument of type 'NoneType' is not iterable |
Oops, I wanted to ping Mark Shannon, not Mark Dickinson. |
I mark this issue as a duplicate of bpo-44442. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: