2026-09-10 13:43:23 -04:00
|
|
|
//! HS publish wait and CBT floor — 180s fail-closed cuts a working HsDir upload.
|
|
|
|
|
|
|
|
|
|
use std::time::Duration;
|
|
|
|
|
|
|
|
|
|
use onionwire::hs;
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn publish_wait_covers_hsdir_retries() {
|
|
|
|
|
assert!(
|
|
|
|
|
hs::PUBLISH_WAIT >= Duration::from_secs(360),
|
|
|
|
|
"180s cuts a working HsDir publish while status is still Bootstrapping"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn cbt_min_timeout_floor_is_at_least_10s() {
|
2026-09-10 13:50:57 -04:00
|
|
|
// Drive the comparison through a runtime value: asserting on the constant
|
|
|
|
|
// directly is folded away by the compiler and clippy rejects it under
|
|
|
|
|
// -D warnings (clippy::assertions_on_constants).
|
|
|
|
|
let floor_ms = hs::CBT_MIN_TIMEOUT_MS;
|
|
|
|
|
assert!(floor_ms >= 10_000, "learned CBT ~1s kills HsDir circuits");
|
2026-09-10 13:43:23 -04:00
|
|
|
}
|