Skip to content

Commit

Permalink
introduce an always-failing fuzzer, to sanity-check our clusterfuzz s…
Browse files Browse the repository at this point in the history
…etup (near#10723)

Based on the clusterfuzz web UI I cannot confirm whether it is actually
working properly, and I’m under the impression that it is actually not
running the fuzzers we’re asking it to.

This fuzzer should make it obvious: if clusterfuzz does not report a
fuzzer failure on it, then it is broken.

There is no good place for it, so I just put it in our current
"everything else" near-primitives crate, as it has basically no internal
dependencies on anything it’ll be very easy to move it out whenever we
actually get close to getting rid of near-primitives.
  • Loading branch information
Ekleog-NEAR authored Mar 8, 2024
1 parent 8e0bdf3 commit 2005a83
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ calimero_zero_storage = []
[dev-dependencies]
assert_matches.workspace = true
bencher.workspace = true
bolero.workspace = true
insta.workspace = true
expect-test.workspace = true

Expand Down
8 changes: 8 additions & 0 deletions core/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,11 @@ pub mod views;

pub use crate::version::checked_feature;
pub use near_primitives_core::chains;

#[cfg(fuzz)]
#[test]
fn failing_fuzzer() {
// This fuzzer always fails. It is used as a sanity-check that our clusterfuzz instance
// is working properly, as it has silently stopped working quite a few times already.
bolero::check!().for_each(|_| panic!("The expected-to-fail fuzzer actually failed"))
}

0 comments on commit 2005a83

Please sign in to comment.