cultnet-rs presence publisher tests: tighten the timeout overrun bound to 1 s plus 250 ms
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 21m44s
Rust crates / cargo test, fmt, clippy (pull_request) Successful in 8m18s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-28 14:47:36 +01:00
commit 65338cfec2

View file

@ -663,8 +663,10 @@ mod lease_wait {
/// An unreachable Odin with connect and ack waits far longer than the
/// caller's timeout: the wait must return at the timeout, over by at most
/// one receive slice plus scheduling. The slack is 400 ms; unbounded, the
/// overrun is the 2 s connect wait, so the bound is not a race.
/// one receive slice plus scheduling. The timeout is 1 s and the slack
/// 250 ms, so a deadline 300 ms late or at twice the timeout both fail;
/// unbounded, the overrun is the 2 s connect wait, so the bound is not a
/// race.
#[test]
fn lease_wait_never_overruns_the_timeout() -> Result<()> {
let dead = dead_address();
@ -677,8 +679,8 @@ mod lease_wait {
..TEST_CADENCE
};
let publisher = publisher_for(&signer, cadence)?;
let timeout = Duration::from_millis(300);
let slack = Duration::from_millis(400);
let timeout = Duration::from_secs(1);
let slack = Duration::from_millis(250);
let started = Instant::now();
let refused = refusal(publisher.wait_for_write_lease(&mut signer, timeout));
@ -708,7 +710,7 @@ mod lease_wait {
};
let publisher = publisher_for(&signer, cadence)?;
let timeout = Duration::from_millis(400);
let slack = Duration::from_millis(300);
let slack = Duration::from_millis(250);
let started = Instant::now();
let refused = refusal(publisher.wait_for_write_lease(&mut signer, timeout));