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
regrtest: don't fail immediately if a child does crash #73548
Comments
When regrtest is used with -jN, regrtest spawn child processes to run tests. If a child crashs, regrtest master process immedialtely fails. It would prefer to be able to continue to run following tests. It's not because a single test crashed that all tests would crash. Example of output when a crash occurs: Current thread 0x00007f9210f11440 (most recent call first): Traceback (most recent call last):
File "/home/haypo/prog/python/git_cpython/Lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
(...)
File "/home/haypo/prog/python/git_cpython/Lib/test/libregrtest/main.py", line 411, in run_tests
run_tests_multiprocess(self)
File "/home/haypo/prog/python/git_cpython/Lib/test/libregrtest/runtest_mp.py", line 221, in run_tests_multiprocess
raise Exception(msg)
Exception: Child error on test_bytes: Exit code -6 |
At least, I would like to see which tests were executed, which tests failed, total duration, etc. Get a summary! |
This patch makes it so that when a child runner crashes during a multiprocess test run, it is treated similar to a keyboard interrupt. That is, the currently running tests will continue to run and immediately after it will print out a summary. I think the test suite should be interrupted when an interpreter crash happens because this indicates a fairly major failure and interrupting the suite brings a lot of attention to it. |
Attached patch changes libregrtest to handle CHILD_ERROR as a normal result and continue the execution of following tests. As a result, it displays the test summary as usual on such crash. -- Ammar Askar: Thanks for regrtest_crash.diff, but I prefer to execute other unit tests rather than exiting immediatly. The --failfast option can be used with my patch to exit at the first crash or failure (with my patch, a crash is handled as a test failure). |
New changeset 4446613000a3 by Victor Stinner in branch 'default': |
New changeset 99e4e687145a76ac28055a651ee31470496c3ac7 by Victor Stinner in branch 'master': |
I fixed regrtest in Python 3.7. Maybe I will backport the fix later to other branches, but I prefer to limit regrtest changes in stable branches. |
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: