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
test.regrtest: -jN (with N != 1) + --slow + child error or interruption = TypeError #69560
Comments
Function runtest() (used by single-process mode) always returns tuple with test result as integer and test time as float. test_times is later used by code, which expects that times are floats: Code used by multi-process mode can return tuple with integer and string (describing error in subprocess), which with --slow option would cause TypeError. Example: In terminal 1: In terminal 2 (sufficiently quickly): Output in terminal 1: Test suite interrupted by signal SIGINT.
1 test omitted:
test_lib2to3
10 slowest tests:
Traceback (most recent call last):
File "/tmp/cpython/Lib/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/tmp/cpython/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmp/cpython/Lib/test/regrtest.py", line 39, in <module>
main_in_temp_cwd()
File "/tmp/cpython/Lib/test/libregrtest/main.py", line 451, in main_in_temp_cwd
main()
File "/tmp/cpython/Lib/test/libregrtest/main.py", line 429, in main
Regrtest().main(tests=tests, **kwargs)
File "/tmp/cpython/Lib/test/libregrtest/main.py", line 389, in main
self.display_result()
File "/tmp/cpython/Lib/test/libregrtest/main.py", line 261, in display_result
print("%s: %.1fs" % (test, time))
TypeError: a float is required My suggested fix is to return string describing error as third element of that tuple. |
New changeset 746b98342943 by Victor Stinner in branch 'default': New changeset ef70e5373131 by Victor Stinner in branch '3.5': |
Python 2.7 is not affected by the bug (I'm unable to reproduce it on Python 2.7). Python 3.4 is near end-of-life and this bug looks like a corner case, I don't think that it's worth to fix it. I fixed the bug in Python 3.5 and 3.6. I added an unit test for Python 3.6 (test_regrtest). Thanks for the report Arfrever. |
Oh! I didn't see that you proposed a fix, sorry. I fixed the bug differently. IMHO it's easier to not add the test to test_times. |
Apparently problem was only reproducible in Python 3, because in Python 3, in "while finished < use_mp" loop, accumulate_result() is called early before checking if result[0] is INTERRUPTED or CHILD_ERROR, while in Python 2, accumulate_result() is called after check for result[0]. |
By the way, should "10 slowest tests:\n" (not followed by anything) be printed if all tests failed with CHILD_ERROR or INTERRUPTED? |
No idea. I don't think that --slow is heavily used in the wild. The current |
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: