Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ debug = true
[profile.release]
debug = true

[profile.proptests]
inherits = "dev"
opt-level = 3

[workspace.lints.rust]
elided_lifetimes_in_paths = "warn"
# https://rust-fuzz.github.io/book/cargo-fuzz/guide.html#cfgfuzzing
Expand Down
6 changes: 3 additions & 3 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ args = [
[tasks.proptests-long]
description = "Run proptests with high case count (runs for ~10 minutes)"
command = "cargo"
args = ["nextest", "run", "-P", "proptests", "--no-fail-fast"]
args = ["nextest", "run", "--package=noq-proto", "-P", "proptests", "--cargo-profile=proptests", "--no-fail-fast", "${@}"]
env = { "PROPTEST_CASES" = "100000" }

[tasks.proptests-light]
description = "Run proptests for CI (~1 minute)"
command = "cargo"
args = ["nextest", "run", "-P", "proptests", "--no-fail-fast"]
args = ["nextest", "run", "--package=noq-proto", "-P", "proptests", "--cargo-profile=proptests", "--no-fail-fast", "${@}"]
env = { "PROPTEST_CASES" = "10000" }

[tasks.proptests-extralight]
description = "Run proptests in regression-only mode (runs for <5 seconds)"
command = "cargo"
args = ["nextest", "run", "-P", "proptests", "--no-fail-fast"]
args = ["nextest", "run", "--package=noq-proto", "-P", "proptests", "--no-fail-fast", "${@}"]
6 changes: 2 additions & 4 deletions noq-proto/src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,7 @@ impl proptest::arbitrary::Arbitrary for PathAck {
(
any::<PathId>(),
varint_u64(),
any::<ArrayRangeSet>()
.prop_filter("ranges must be non empty", |ranges| !ranges.is_empty()),
any::<ArrayRangeSet>(),
any::<Option<EcnCounts>>(),
)
.prop_map(|(path_id, delay, ranges, ecn)| Self {
Expand Down Expand Up @@ -1134,8 +1133,7 @@ impl proptest::arbitrary::Arbitrary for Ack {
use proptest::prelude::*;
(
varint_u64(),
any::<ArrayRangeSet>()
.prop_filter("ranges must be non empty", |ranges| !ranges.is_empty()),
any::<ArrayRangeSet>(),
any::<Option<EcnCounts>>(),
)
.prop_map(|(delay, ranges, ecn)| Self {
Expand Down
2 changes: 1 addition & 1 deletion noq-proto/src/range_set/array_range_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl proptest::arbitrary::Arbitrary for ArrayRangeSet {
use proptest::prelude::*;
// Generate 1-8 ranges. Each range is defined by a gap from the previous and a size.
// We use small values to keep encoding reasonable.
prop::collection::vec((1u64..100, 1u64..50), 0..8)
prop::collection::vec((1u64..100, 1u64..50), 1..8)
.prop_map(|gaps_and_sizes| {
let mut ranges = Self::new();
let mut pos = 0u64;
Expand Down
Loading
Loading