Repository navigation
test(contracts): add subscription fuzz regression harness + configurable iterations (#1806) - #1831
Open
nissinanlung wants to merge 1 commit into
Open
nissinanlung wants to merge 1 commit into
nissinanlung wants to merge 1 commit into
Conversation
…ble iterations (Smartdevs17#1806) Add a stable-toolchain regression replay harness that turns libFuzzer crash artifacts into deterministic cargo-test cases, plus configurable iteration counts for both coverage-guided and in-process fuzzing. Changes: - Add contracts/subscription/tests/fuzz_regressions.rs: replay_lifecycle mirroring the subscription_lifecycle fuzz target, three tests — replay_known_corpus_seeds, deterministic_in_process_fuzz_configurable_iterations (FUZZ_REGRESSION_ITERATIONS, default 64), and replay_crash_artifacts_from_regressions_dir which replays every .bin under tests/regressions/. Runs on stable cargo. - Update .github/workflows/fuzz-test.yml: add fuzz_runs workflow_dispatch input (-runs=N overrides -max_total_time); add regression-replay job running the stable harness on every PR (FUZZ_REGRESSION_ITERATIONS=128) - Update contracts/fuzz/FUZZING.md: document configurable iterations (time vs -runs), the regression replay workflow, and triage-to-guard promotion Acceptance criteria: - [x] Configurable iterations — FUZZ_REGRESSION_ITERATIONS for in-process smoke; fuzz_runs (-runs=N) / fuzz_seconds for cargo-fuzz in CI - [x] In CI — regression-replay job runs the stable harness on every PR; fuzz job runs coverage-guided targets with configurable bounds - [x] Failures reproducible — triage-crash.sh promotes crashes into tests/regressions/ which are replayed deterministically on every run
|
@nissinanlung Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
| FUZZ_REGRESSION_ITERATIONS: "128" | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 |
| uses: actions/checkout@v7 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable |
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Cache cargo | ||
| uses: actions/cache@v6 |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1806.
Edge inputs for the subscription contract were not covered by a reproducible, CI-integrated harness. This adds a stable-toolchain regression replay harness that turns libFuzzer crash artifacts into deterministic
cargo testcases, plus configurable iteration counts for both coverage-guided (cargo-fuzz) and in-process fuzzing.Changes
contracts/subscription/tests/fuzz_regressions.rs—replay_lifecyclemirrors thesubscription_lifecyclefuzz target; three tests:replay_known_corpus_seeds— hand-crafted lifecycle seeds.deterministic_in_process_fuzz_configurable_iterations— seeded SplitMix64 fuzzer, iterations viaFUZZ_REGRESSION_ITERATIONS(default 64).replay_crash_artifacts_from_regressions_dir— replays every.binundertests/regressions/..github/workflows/fuzz-test.yml— newfuzz_runsinput (-runs=Noverrides-max_total_time); newregression-replayjob runs the stable harness on every PR (FUZZ_REGRESSION_ITERATIONS=128).contracts/fuzz/FUZZING.md— documents configurable iterations (time vs-runs), the regression replay workflow, and triage-to-guard promotion.Acceptance criteria
FUZZ_REGRESSION_ITERATIONSfor the in-process smoke;fuzz_runs(-runs=N) /fuzz_secondsforcargo-fuzzin CI.regression-replayjob runs the stable harness on every PR;fuzzjob runs coverage-guided targets with configurable bounds.triage-crash.shpromotes crashes intotests/regressions/, which are replayed deterministically on every run; a fixed bug can never silently regress.Quality Gates
cargo test --test fuzz_regressions, stable)