Commit 0d5f039
fbcode_builder: fix dead retry loop in ctest test runner
Summary:
The ctest retry loop in BuilderBase test_results_for_retry was calling
self._check_cmd(args, allow_fail=True) and capturing its return code,
but _check_cmd raises RuntimeError whenever its inner _run_cmd returns
non-zero — independently of allow_fail (which is only forwarded to
_run_cmd to suppress the lower-level raise). On the first ctest
failure the loop therefore raised out before ever reaching the
--rerun-failed retry path: the retry was dead code.
Switch the call to _run_cmd so a non-zero exit is returned and the
retry loop actually runs. This also lets us drop the int|None typing
dance (retcode could only ever be None when a never-thrown exception
ate the assignment) and the corresponding 'is not None' guard. The
FIXME asking what the loop accomplishes is removed: the answer is
'rerun failed tests up to retry times', which is now what it does.
Reviewed By: bigfootjon
Differential Revision: D103767928
fbshipit-source-id: 466cb4ce598acbb2458fe4327e5d322fe12cffbd1 parent 1149ac5 commit 0d5f039
1 file changed
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1330 | 1330 | | |
1331 | 1331 | | |
1332 | 1332 | | |
1333 | | - | |
| 1333 | + | |
1334 | 1334 | | |
1335 | | - | |
1336 | | - | |
| 1335 | + | |
1337 | 1336 | | |
1338 | 1337 | | |
1339 | 1338 | | |
| |||
1343 | 1342 | | |
1344 | 1343 | | |
1345 | 1344 | | |
1346 | | - | |
| 1345 | + | |
1347 | 1346 | | |
1348 | 1347 | | |
1349 | 1348 | | |
| |||
0 commit comments