Skip to content

Commit fe3b9ab

Browse files
committed
ci(fuzzing): treat timeout as a successful workflow run
If we hit the fuzzing timeout, it means no crashes happenened, therefore it makes no sense to treat it as a workflow failure. "timeout" returns an exit code 124 when this happens, and by default the Github runners treat non-zero ones as a failure. Change the logic to convert the exit code 124 to 0 (success) and pass everything else (legitimate failures) through. Closes #5244. Signed-off-by: Alex T. <[email protected]>
1 parent bd84c97 commit fe3b9ab

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/fuzzing.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,10 @@ jobs:
103103
at_index=$(((10#$(date -u +%U)) % ${#fuzzing_scripts[@]}))
104104
selected_script="${fuzzing_scripts[$at_index]}"
105105
echo "Selected script: $selected_script"
106-
timeout --preserve-status --signal=SIGINT 60m python $selected_script
106+
# Disable the default Github runner fail-fast behaviour for better timeout handling
107+
set +e
108+
timeout --signal=SIGINT 60m python $selected_script
109+
# "timeout" returns 124 when the command times out.
110+
# We treat this as a success (nothing found during the allotted time) and pass other exit codes through.
111+
fuzz_exitcode=$?
112+
[ $fuzz_exitcode -eq 124 ] && exit 0 || exit $fuzz_exitcode

0 commit comments

Comments
 (0)