Skip to content

Commit

Permalink
fix: use fuzz timeout directly
Browse files Browse the repository at this point in the history
  • Loading branch information
erikburt committed Nov 6, 2024
1 parent 8a0ae4b commit c30badb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ jobs:
run: |
echo "TIMEOUT=10m" >> $GITHUB_ENV
echo "COUNT=50" >> $GITHUB_ENV
echo "FUZZ_SECONDS=500">> $GITHUB_ENV
echo "FUZZ_TIMEOUT_MINUTES=10">> $GITHUB_ENV
- name: Install gotestloghelper
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
Expand Down
12 changes: 9 additions & 3 deletions tools/bin/go_core_fuzz
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ set +e

SCRIPT_PATH=`dirname "$0"`; SCRIPT_PATH=`eval "cd \"$SCRIPT_PATH\" && pwd"`
OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"}
FUZZ_TIMEOUT=${FUZZ_TIMEOUT:-10m}
FUZZ_SECONDS=${FUZZ_SECONDS:-"300"}
FUZZ_TIMEOUT_MINUTES=${FUZZ_TIMEOUT_MINUTES:-"6"}

TOTAL_SECONDS=$((FUZZ_TIMEOUT_MINUTES * 60))
if (( TOTAL_SECONDS > 60 )); then
FUZZ_SECONDS=$((TOTAL_SECONDS - 60))
else
FUZZ_SECONDS=$TOTAL_SECONDS
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}" ./fuzz/fuzz_all_native.py --ci --seconds "$FUZZ_SECONDS" --go_module_root ./ | tee $OUTPUT_FILE
timeout "${FUZZ_TIMEOUT_MINUTES}"m ./fuzz/fuzz_all_native.py --ci --seconds "$FUZZ_SECONDS" --go_module_root ./ | tee $OUTPUT_FILE
EXITCODE=${PIPESTATUS[0]}

# Assert no known sensitive strings present in test logger output
Expand Down

0 comments on commit c30badb

Please sign in to comment.