Commit 148a592
committed
ZTS: fail test run if test runner crashes unexpectedly
zfs-tests.sh executes test-runner.py to do the actual test work. Any
exit code < 4 is interpreted as success, with the actual value
describing the outcome of the tests inside.
If a Python program crashes in some way (eg an uncaught exception), the
process exit code is 1.
Taken together, this means that test-runner.py can crash during setup,
but return a "success" error code to zfs-tests.sh, which will report and
exit 0. This in turn causes the CI runner to believe the test run
completed successfully.
This commit addresses this by making zfs-tests.sh interpret an exit code
of 255 as a failure in the runner itself. Then, in test-runner.py, the
"fail()" function defaults to a 255 return, and the main function gets
wrapped in a generic exception handler, which prints it and calls
fail().
All together, this should mean that any unexpected failure in the test
runner itself will be propagated out of zfs-tests.sh for CI or any other
calling program to deal with.
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <[email protected]>1 parent 3a55e76 commit 148a592
File tree
2 files changed
+22
-14
lines changed- scripts
- tests/test-runner/bin
2 files changed
+22
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
797 | 797 | | |
798 | 798 | | |
799 | 799 | | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
800 | 804 | | |
801 | 805 | | |
802 | 806 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
1138 | 1139 | | |
1139 | 1140 | | |
1140 | 1141 | | |
1141 | | - | |
| 1142 | + | |
1142 | 1143 | | |
1143 | 1144 | | |
1144 | 1145 | | |
| |||
1247 | 1248 | | |
1248 | 1249 | | |
1249 | 1250 | | |
1250 | | - | |
| 1251 | + | |
| 1252 | + | |
1251 | 1253 | | |
1252 | | - | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
1256 | 1258 | | |
1257 | | - | |
1258 | | - | |
| 1259 | + | |
| 1260 | + | |
1259 | 1261 | | |
1260 | | - | |
1261 | | - | |
1262 | | - | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
1263 | 1265 | | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
1267 | 1269 | | |
| 1270 | + | |
| 1271 | + | |
1268 | 1272 | | |
1269 | 1273 | | |
1270 | 1274 | | |
0 commit comments