tests: clean up more tests across the project
Rust CI / cargo fmt (push) Successful in 17s
Rust CI / cargo check (x86_64-unknown-linux-gnu) (push) Successful in 33s
Rust CI / cargo clippy (push) Successful in 34s
Rust CI / cargo test (x86_64-unknown-linux-gnu) (push) Failing after 33s
Rust CI / cargo check (x86_64-unknown-linux-musl) (push) Failing after 9s
Rust CI / cargo test (x86_64-unknown-linux-musl) (push) Failing after 8s
Rust CI / cargo doc (push) Successful in 22s
Fuzz Smoke / cargo fuzz smoke (push) Failing after 27s
Supply chain / cargo-deny advisories (push) Successful in 7s
Supply chain / cargo-deny bans licenses sources (push) Successful in 6s
Supply chain / actionlint (push) Successful in 3s
Netem Interop / netem interop (push) Successful in 1m3s
Rust CI / cargo fmt (push) Successful in 17s
Rust CI / cargo check (x86_64-unknown-linux-gnu) (push) Successful in 33s
Rust CI / cargo clippy (push) Successful in 34s
Rust CI / cargo test (x86_64-unknown-linux-gnu) (push) Failing after 33s
Rust CI / cargo check (x86_64-unknown-linux-musl) (push) Failing after 9s
Rust CI / cargo test (x86_64-unknown-linux-musl) (push) Failing after 8s
Rust CI / cargo doc (push) Successful in 22s
Fuzz Smoke / cargo fuzz smoke (push) Failing after 27s
Supply chain / cargo-deny advisories (push) Successful in 7s
Supply chain / cargo-deny bans licenses sources (push) Successful in 6s
Supply chain / actionlint (push) Successful in 3s
Netem Interop / netem interop (push) Successful in 1m3s
This commit is contained in:
17 files changed
+28
-1435
No files matched your search
@@ -27,33 +27,6 @@ fn exact_mode_grows_with_probe_count() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn exact_mode_scales_linearly_with_probe_count() {
|
||||
let config = StatsConfig::finite();
|
||||
let single = config.estimated_retained_bytes(1);
|
||||
|
||||
assert_eq!(config.estimated_retained_bytes(1_000), single * 1_000);
|
||||
}
|
||||
|
||||
/// Exact mode retains eleven `i128` timing streams per probe alongside its
|
||||
/// IPDV tracker state, so the timing samples alone are at least that much.
|
||||
///
|
||||
/// This checks the estimate against the storage it claims to model. It is an
|
||||
/// implementation test, not a stable public constant: the figure is free to
|
||||
/// move whenever the retention model does.
|
||||
#[test]
|
||||
fn exact_estimate_covers_every_retained_timing_sample() {
|
||||
const EXACT_TIMING_STREAMS: u64 = 11;
|
||||
let per_probe = StatsConfig::finite().estimated_retained_bytes(1);
|
||||
let timing_sample_bytes = EXACT_TIMING_STREAMS * std::mem::size_of::<i128>() as u64;
|
||||
|
||||
assert!(
|
||||
per_probe > timing_sample_bytes,
|
||||
"the estimate should cover {EXACT_TIMING_STREAMS} retained timing samples plus \
|
||||
IPDV tracker state, but a probe estimated only {per_probe} bytes"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enormous_probe_counts_saturate_instead_of_wrapping() {
|
||||
for config in [StatsConfig::finite(), StatsConfig::continuous()] {
|
||||
@@ -90,27 +63,6 @@ fn running_only_does_not_report_unbounded_per_probe_retention() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn finite_config_estimate_is_deterministic_and_usable_for_planning() {
|
||||
let config = StatsConfig::finite();
|
||||
let probes = 1_000_000;
|
||||
let first = config.estimated_retained_bytes(probes);
|
||||
|
||||
assert_eq!(first, config.estimated_retained_bytes(probes));
|
||||
|
||||
// A million probes should land in a range a caller can reason about: well
|
||||
// over a megabyte, and well under a terabyte. The exact figure is free to
|
||||
// move with the retention model.
|
||||
assert!(
|
||||
first > 1024 * 1024,
|
||||
"a million probes should estimate more than a MiB, got {first}"
|
||||
);
|
||||
assert!(
|
||||
first < 1024 * 1024 * 1024 * 1024,
|
||||
"a million probes should estimate less than a TiB, got {first}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rolling_count_adds_bounded_retention() {
|
||||
let probes = 1_000_000;
|
||||
|
||||
Reference in new issue
Block a user