From 6ab0110964af9f8b39b52346e0c49dcad468c797 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 26 Mar 2024 13:38:44 +1100 Subject: [PATCH] Run fuzzer daily Waiting for the fuzzer slows down the dev feedback loop because it makes CI slow. We still want fuzz coverage but not in a way that slows down devs. Instead of running the fuzzer on every PR just run it once a nightly. As we do for other daily jobs, rename the yaml file to make explicit what it does. Open questions: - This should run for 30 minutes but I can't work out why the current set up only runs for a shorter time than that? - Is this less fuzzing i.e., is 30 minutes once a day better or worse that 1 minute 30 times? --- .../workflows/{fuzz.yml => cron-daily-fuzz.yml} | 14 ++++++++------ fuzz/fuzz.sh | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) rename .github/workflows/{fuzz.yml => cron-daily-fuzz.yml} (89%) diff --git a/.github/workflows/fuzz.yml b/.github/workflows/cron-daily-fuzz.yml similarity index 89% rename from .github/workflows/fuzz.yml rename to .github/workflows/cron-daily-fuzz.yml index 3a0e4d1a..63986907 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/cron-daily-fuzz.yml @@ -1,12 +1,12 @@ # Automatically generated by fuzz/generate-files.sh name: Fuzz - on: - push: - branches: - - master - - 'test-ci/**' - pull_request: + schedule: + # 5am every day UTC, this correlates to: + # - 10pm PDT + # - 6am CET + # - 4pm AEDT + - cron: '00 05 * * *' jobs: fuzz: @@ -15,6 +15,8 @@ jobs: strategy: fail-fast: false matrix: + # We only get 20 jobs at a time, we probably don't want to go + # over that limit with fuzzing because of the hour run time. fuzz_target: [ bitcoin_deserialize_address, bitcoin_deserialize_block, diff --git a/fuzz/fuzz.sh b/fuzz/fuzz.sh index 5fc65ae6..a22e01cc 100755 --- a/fuzz/fuzz.sh +++ b/fuzz/fuzz.sh @@ -28,7 +28,7 @@ for targetFile in $targetFiles; do else HFUZZ_INPUT_ARGS="" fi - HFUZZ_RUN_ARGS="--run_time 30 --exit_upon_crash -v $HFUZZ_INPUT_ARGS" cargo hfuzz run "$targetName" + HFUZZ_RUN_ARGS="--run_time 3600 --exit_upon_crash -v $HFUZZ_INPUT_ARGS" cargo hfuzz run "$targetName" checkReport "$targetName" done