Skip to content

Commit

Permalink
fix: greater gap for fuzz test seconds vs timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
erikburt committed Nov 6, 2024
1 parent c30badb commit c040274
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tools/bin/go_core_fuzz
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"}
FUZZ_TIMEOUT_MINUTES=${FUZZ_TIMEOUT_MINUTES:-"6"}

TOTAL_SECONDS=$((FUZZ_TIMEOUT_MINUTES * 60))
if (( TOTAL_SECONDS > 60 )); then
FUZZ_SECONDS=$((TOTAL_SECONDS - 60))
if (( TOTAL_SECONDS > 120 )); then
# Allow for a 90 second buffer between the timeout, and fuzz test runtime
FUZZ_SECONDS=$((TOTAL_SECONDS - 90))
else
FUZZ_SECONDS=$TOTAL_SECONDS
echo "Increase FUZZ_TIMEOUT_MINUTES to >=2, received $FUZZ_TIMEOUT_MINUTES"
exit 1
fi

echo "Failed fuzz tests and panics: ---------------------"
echo ""
# the amount of --seconds here is subject to change based on how long the CI job takes in the future
# as we add more fuzz tests, we should take into consideration increasing this timelapse, so we can have enough coverage.
# We are timing out after ~10mins in case the tests hang. (Current CI duration is ~8m, modify if needed)
timeout "${FUZZ_TIMEOUT_MINUTES}"m ./fuzz/fuzz_all_native.py --ci --seconds "$FUZZ_SECONDS" --go_module_root ./ | tee $OUTPUT_FILE
EXITCODE=${PIPESTATUS[0]}

Expand Down

0 comments on commit c040274

Please sign in to comment.