diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-02-06 11:42:00 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-02-06 11:42:00 (GMT) |
commit | 5bad70def671612835d1fdacd83f8534920f4dcd (patch) | |
tree | b80b13b2f7bd3b431281b2d4ee9ed77f62c69e21 /Lib/test/libregrtest/runtest_mp.py | |
parent | 7b620a448e95387cdd79c56937a700deb6079b14 (diff) | |
download | cpython-5bad70def671612835d1fdacd83f8534920f4dcd.zip cpython-5bad70def671612835d1fdacd83f8534920f4dcd.tar.gz cpython-5bad70def671612835d1fdacd83f8534920f4dcd.tar.bz2 |
regrtest: don't fail immediately if a child does crash
Issue #29362: Catch a crash of a worker process as a normal failure and
continue to run next tests. It allows to get the usual test summary: single
line result (OK/FAIL), total duration, etc.
Diffstat (limited to 'Lib/test/libregrtest/runtest_mp.py')
-rw-r--r-- | Lib/test/libregrtest/runtest_mp.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py index 74ac4fa..34b3ae6 100644 --- a/Lib/test/libregrtest/runtest_mp.py +++ b/Lib/test/libregrtest/runtest_mp.py @@ -129,7 +129,7 @@ class MultiprocessThread(threading.Thread): result = (CHILD_ERROR, "Exit code %s" % retcode) self.output.put((test, stdout.rstrip(), stderr.rstrip(), result)) - return True + return False if not result: self.output.put((None, None, None, None)) @@ -203,6 +203,8 @@ def run_tests_multiprocess(regrtest): and test_time >= PROGRESS_MIN_TIME and not regrtest.ns.pgo): text += ' (%.0f sec)' % test_time + elif ok == CHILD_ERROR: + text = '%s (%s)' % (text, test_time) running = get_running(workers) if running and not regrtest.ns.pgo: text += ' -- running: %s' % ', '.join(running) @@ -216,9 +218,6 @@ def run_tests_multiprocess(regrtest): if result[0] == INTERRUPTED: raise KeyboardInterrupt - if result[0] == CHILD_ERROR: - msg = "Child error on {}: {}".format(test, result[1]) - raise Exception(msg) test_index += 1 except KeyboardInterrupt: regrtest.interrupted = True |