From 173f28b886c78c7cbb429bda3f7f86fbc525a2d4 Mon Sep 17 00:00:00 2001 From: Eureka Date: Tue, 10 Nov 2026 23:38:33 +0000 Subject: [PATCH] Desk door tests: the one-second lower edge allows jiffy granularity (950 ms still kills a 500 ms bound) Co-Authored-By: Claude Sonnet 5.5 --- crates/huginn-daemon/src/desk_door_tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/huginn-daemon/src/desk_door_tests.rs b/crates/huginn-daemon/src/desk_door_tests.rs index 60d09ad..2ad1951 100644 --- a/crates/huginn-daemon/src/desk_door_tests.rs +++ b/crates/huginn-daemon/src/desk_door_tests.rs @@ -785,7 +785,7 @@ mod bounds { let started = Instant::now(); assert_eq!(rig.door.serve_ready(&mut rig.daemon, now()), 1); let took = started.elapsed(); - assert!(took >= Duration::from_millis(1000), "the connection was cut after {took:?}, short of one second"); + assert!(took >= Duration::from_millis(950), "the connection was cut after {took:?}, short of the one-second deadline (the kernel timeout is jiffy-granular)"); assert!(took < Duration::from_millis(1250), "the connection held the loop for {took:?}"); }); } @@ -826,7 +826,7 @@ mod bounds { let took = started.elapsed(); // The kernel's send timeout reads as WouldBlock; the deadline already spent reads as TimedOut. assert!(matches!(error.kind(), std::io::ErrorKind::WouldBlock | std::io::ErrorKind::TimedOut), "{error:?}"); - assert!(took >= Duration::from_millis(1000) && took < Duration::from_millis(1250), "the write was cut after {took:?}"); + assert!(took >= Duration::from_millis(950) && took < Duration::from_millis(1250), "the write was cut after {took:?}"); assert_eq!(stream.write(&chunk).unwrap_err().kind(), std::io::ErrorKind::TimedOut, "once spent, nothing more is written"); }