bpo-46542: test_lib2to3 uses support.infinite_recursion()#31035
Conversation
Fix a Python crash in test_lib2to3 when using Python built in debug mode: limit the recursion limit. The test_all_project_files() test of test_lib2to3 now uses the test.support.infinite_recursion() context manager when processing the infinite_recursion.py file to prevent a crash when Python is built in debug mode. The two test_all_project_files() tests now use subTest() and log the refactored/parsed filename (if test_lib2to3 is run in verbose mode).
Sorry, something went wrong.
|
I built Python in debug mode with clang: clang uses Without this change (current main branch, at commit 7685693), test_lib2to3 does crash :-( With this PR, it no longer crash: |
Sorry, something went wrong.
|
By the way, |
Sorry, something went wrong.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
…1035) * bpo-46542: test_lib2to3 uses support.infinite_recursion() Fix a Python crash in test_lib2to3 when using Python built in debug mode: limit the recursion limit. The test_all_project_files() test of test_lib2to3 now uses the test.support.infinite_recursion() context manager when processing the infinite_recursion.py file to prevent a crash when Python is built in debug mode. The two test_all_project_files() tests now use subTest() and log the refactored/parsed filename (if test_lib2to3 is run in verbose mode). * Update Lib/lib2to3/tests/data/infinite_recursion.py Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit ee0ac32) Co-authored-by: Victor Stinner <vstinner@python.org>
…1035) * bpo-46542: test_lib2to3 uses support.infinite_recursion() Fix a Python crash in test_lib2to3 when using Python built in debug mode: limit the recursion limit. The test_all_project_files() test of test_lib2to3 now uses the test.support.infinite_recursion() context manager when processing the infinite_recursion.py file to prevent a crash when Python is built in debug mode. The two test_all_project_files() tests now use subTest() and log the refactored/parsed filename (if test_lib2to3 is run in verbose mode). * Update Lib/lib2to3/tests/data/infinite_recursion.py Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit ee0ac32) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-46542: test_lib2to3 uses support.infinite_recursion() Fix a Python crash in test_lib2to3 when using Python built in debug mode: limit the recursion limit. The test_all_project_files() test of test_lib2to3 now uses the test.support.infinite_recursion() context manager when processing the infinite_recursion.py file to prevent a crash when Python is built in debug mode. The two test_all_project_files() tests now use subTest() and log the refactored/parsed filename (if test_lib2to3 is run in verbose mode). * Update Lib/lib2to3/tests/data/infinite_recursion.py Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit ee0ac32) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-46542: test_lib2to3 uses support.infinite_recursion() Fix a Python crash in test_lib2to3 when using Python built in debug mode: limit the recursion limit. The test_all_project_files() test of test_lib2to3 now uses the test.support.infinite_recursion() context manager when processing the infinite_recursion.py file to prevent a crash when Python is built in debug mode. The two test_all_project_files() tests now use subTest() and log the refactored/parsed filename (if test_lib2to3 is run in verbose mode). * Update Lib/lib2to3/tests/data/infinite_recursion.py Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit ee0ac32) Co-authored-by: Victor Stinner <vstinner@python.org>
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot AMD64 FreeBSD Shared 3.9 has failed when building commit 3046386. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/151/builds/439 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Tests result: FAILURE then FAILURE == 405 tests OK. 10 slowest tests:
2 tests failed: 18 tests skipped: 2 re-run tests: Total duration: 44 min 42 sec Click to see traceback logsTraceback (most recent call last):
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/test/test_unicodedata.py", line 330, in test_normalization
testdata = open_urlresource(TESTDATAURL, encoding="utf-8",
http.client.IncompleteRead: IncompleteRead(0 bytes read)
Traceback (most recent call last):
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/urllib/request.py", line 1346, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
socket.gaierror: [Errno 8] Name does not resolve
Traceback (most recent call last):
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/test/test_unicodedata.py", line 336, in test_normalization
self.fail(f"Could not retrieve {TESTDATAURL}")
AssertionError: Could not retrieve http://www.pythontest.net/unicode/13.0.0/NormalizationTest.txt
Traceback (most recent call last):
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/test/test_smtpnet.py", line 59, in test_connect_default_port
server = smtplib.SMTP_SSL(self.testServer)
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/smtplib.py", line 1050, in __init__
SMTP.__init__(self, host, port, local_hostname, timeout,
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/smtplib.py", line 255, in __init__
(code, msg) = self.connect(host, port)
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/smtplib.py", line 343, in connect
(code, msg) = self.getreply()
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/smtplib.py", line 405, in getreply
raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed
Traceback (most recent call last):
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/http/client.py", line 597, in _readinto_chunked
n = self._safe_readinto(mvb)
http.client.IncompleteRead: IncompleteRead(296 bytes read, 1795 more expected)
Traceback (most recent call last):
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/test/test_unicodedata.py", line 330, in test_normalization
testdata = open_urlresource(TESTDATAURL, encoding="utf-8",
urllib.error.URLError: <urlopen error [Errno 8] Name does not resolve>
Traceback (most recent call last):
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/test/test_smtpnet.py", line 52, in test_connect
server = smtplib.SMTP_SSL(self.testServer, self.remotePort)
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/smtplib.py", line 1050, in __init__
SMTP.__init__(self, host, port, local_hostname, timeout,
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/smtplib.py", line 255, in __init__
(code, msg) = self.connect(host, port)
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/smtplib.py", line 343, in connect
(code, msg) = self.getreply()
File "/usr/home/buildbot/python/3.9.koobs-freebsd-564d/build/Lib/smtplib.py", line 405, in getreply
raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed
|
Sorry, something went wrong.
|
Looks like DNS is broken on the buildbot. Unlikely to be related to this PR. |
Sorry, something went wrong.
…1035) * bpo-46542: test_lib2to3 uses support.infinite_recursion() Fix a Python crash in test_lib2to3 when using Python built in debug mode: limit the recursion limit. The test_all_project_files() test of test_lib2to3 now uses the test.support.infinite_recursion() context manager when processing the infinite_recursion.py file to prevent a crash when Python is built in debug mode. The two test_all_project_files() tests now use subTest() and log the refactored/parsed filename (if test_lib2to3 is run in verbose mode). * Update Lib/lib2to3/tests/data/infinite_recursion.py Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit ee0ac32) Co-authored-by: Victor Stinner <vstinner@python.org>
Fix a Python crash in test_lib2to3 when using Python built in debug
mode: limit the recursion limit.
The test_all_project_files() test of test_lib2to3 now uses the
test.support.infinite_recursion() context manager when processing the
infinite_recursion.py file to prevent a crash when Python is built in
debug mode.
The two test_all_project_files() tests now use subTest() and log the
refactored/parsed filename (if test_lib2to3 is run in verbose mode).
https://bugs.python.org/issue46542