bpo-36719: regrtest -jN no longer stops on crash (GH-13231)
"python3 -m test -jN ..." now continues the execution of next tests
when a worker process crash (CHILD_ERROR state). Previously, the test
suite stopped immediately. Use --failfast to stop at the first error.
Moreover, --forever now also implies --failfast.
diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py
index a957492..a43b766 100644
--- a/Lib/test/libregrtest/runtest.py
+++ b/Lib/test/libregrtest/runtest.py
@@ -24,7 +24,7 @@
RESOURCE_DENIED = -3
INTERRUPTED = -4
CHILD_ERROR = -5 # error in a child process
-TEST_DID_NOT_RUN = -6 # error in a child process
+TEST_DID_NOT_RUN = -6
_FORMAT_TEST_RESULT = {
PASSED: '%s passed',
@@ -64,6 +64,15 @@
FOUND_GARBAGE = []
+def is_failed(result, ns):
+ ok = result.result
+ if ok in (PASSED, RESOURCE_DENIED, SKIPPED, TEST_DID_NOT_RUN):
+ return False
+ if ok == ENV_CHANGED:
+ return ns.fail_env_changed
+ return True
+
+
def format_test_result(result):
fmt = _FORMAT_TEST_RESULT.get(result.result, "%s")
return fmt % result.test_name