summaryrefslogtreecommitdiffstats
path: root/Lib/test/libregrtest/result.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-09-30 20:48:26 (GMT)
committerGitHub <noreply@github.com>2023-09-30 20:48:26 (GMT)
commit2c234196ea30b9da370780204ed9068f1fb134c6 (patch)
tree18f3e79aafba9bbadfb27f26904e52a8e08341a3 /Lib/test/libregrtest/result.py
parentc62b49ecc8da13fa9522865ef6fe0aec194fd0d8 (diff)
downloadcpython-2c234196ea30b9da370780204ed9068f1fb134c6.zip
cpython-2c234196ea30b9da370780204ed9068f1fb134c6.tar.gz
cpython-2c234196ea30b9da370780204ed9068f1fb134c6.tar.bz2
gh-109276: regrtest: add WORKER_FAILED state (#110148)
Rename WORKER_ERROR to WORKER_BUG. Add WORKER_FAILED state: it does not stop the manager, whereas WORKER_BUG does. Change also TestResults.display_result() order: display failed tests at the end, the important important information. WorkerThread now tries to get the signal name for negative exit code.
Diffstat (limited to 'Lib/test/libregrtest/result.py')
-rw-r--r--Lib/test/libregrtest/result.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/Lib/test/libregrtest/result.py b/Lib/test/libregrtest/result.py
index bf88526..d6b0d5a 100644
--- a/Lib/test/libregrtest/result.py
+++ b/Lib/test/libregrtest/result.py
@@ -19,7 +19,8 @@ class State:
ENV_CHANGED = "ENV_CHANGED"
RESOURCE_DENIED = "RESOURCE_DENIED"
INTERRUPTED = "INTERRUPTED"
- MULTIPROCESSING_ERROR = "MULTIPROCESSING_ERROR"
+ WORKER_FAILED = "WORKER_FAILED" # non-zero worker process exit code
+ WORKER_BUG = "WORKER_BUG" # exception when running a worker
DID_NOT_RUN = "DID_NOT_RUN"
TIMEOUT = "TIMEOUT"
@@ -29,7 +30,8 @@ class State:
State.FAILED,
State.UNCAUGHT_EXC,
State.REFLEAK,
- State.MULTIPROCESSING_ERROR,
+ State.WORKER_FAILED,
+ State.WORKER_BUG,
State.TIMEOUT}
@staticmethod
@@ -42,14 +44,16 @@ class State:
State.SKIPPED,
State.RESOURCE_DENIED,
State.INTERRUPTED,
- State.MULTIPROCESSING_ERROR,
+ State.WORKER_FAILED,
+ State.WORKER_BUG,
State.DID_NOT_RUN}
@staticmethod
def must_stop(state):
return state in {
State.INTERRUPTED,
- State.MULTIPROCESSING_ERROR}
+ State.WORKER_BUG,
+ }
@dataclasses.dataclass(slots=True)
@@ -108,8 +112,10 @@ class TestResult:
return f"{self.test_name} skipped (resource denied)"
case State.INTERRUPTED:
return f"{self.test_name} interrupted"
- case State.MULTIPROCESSING_ERROR:
- return f"{self.test_name} process crashed"
+ case State.WORKER_FAILED:
+ return f"{self.test_name} worker non-zero exit code"
+ case State.WORKER_BUG:
+ return f"{self.test_name} worker bug"
case State.DID_NOT_RUN:
return f"{self.test_name} ran no tests"
case State.TIMEOUT: