Skip to content

Commit

Permalink
Adjust fuzzing runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
erikburt committed Nov 7, 2024
1 parent 2763f02 commit ab1e452
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions fuzz/fuzz_all_native.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ def main():
durations_seconds = [60] if os.getenv('GITHUB_EVENT_NAME') == 'scheduled' else [45]
if args.seconds:
# However, if seconds was specified, evenly divide total time among all fuzzers
# leaving a 5 second buffer for processing/building time between fuzz runs
actual_fuzz_time = total_time - (num_fuzzers * 5)
# leaving a 10 second buffer for processing/building time between fuzz runs
actual_fuzz_time = total_time - (num_fuzzers * 10)
if actual_fuzz_time <= 5 * num_fuzzers:
print(f"Seconds (--seconds {arg.seconds}) is too low to properly run fuzzers for 5sec each. Exiting.")
exit(1)
durations_seconds = [ actual_fuzz_time / num_fuzzers ]

for duration_seconds in durations_seconds:
Expand Down
4 changes: 2 additions & 2 deletions tools/bin/go_core_fuzz
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ FUZZ_TIMEOUT_MINUTES=${FUZZ_TIMEOUT_MINUTES:-"5"}

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

0 comments on commit ab1e452

Please sign in to comment.