Commit 6b32b70
committed
test: reap the timed-out test before its return code is used
Review catch. The TimeoutExpired handler called kill() and drained stdout
but never wait()ed, so fop.returncode stayed None -- and the shared exit
path below evaluates:
rc += abs(int(fop.returncode))
which raises TypeError on None. The first timed-out test would therefore
abort the whole group as a Python exception instead of failing one test.
Latent until now: the timeout could never fire while the read loop blocked
in readline(), so this path was unreachable. Enabling the timeout in the
previous commit makes it reachable, so it has to be fixed in the same PR.
wait() after the drain yields -SIGKILL, so abs(int(...)) contributes 9 and
the timed-out test is correctly scored as failed. Verified directly:
returncode None before wait(), -9 after.
Also switches the drain's decode to errors='replace', matching the main
read loop -- a hung test is exactly the case likely to emit a truncated
multi-byte sequence, which would otherwise throw inside the handler.1 parent 81c5290 commit 6b32b70
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
889 | | - | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
890 | 898 | | |
891 | 899 | | |
892 | 900 | | |
| |||
0 commit comments