From 0d6990ac904075e75f72fcb2b32389efca3a6fc4 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 27 Nov 2026 19:50:55 -0800 Subject: [PATCH] automation: the frozen-clock test server keeps a 30-second socket wait The frozen clock in `serve_counting_ends` keeps the time left to the authentication deadline at 10 seconds, and the server's socket read timeout, which runs on real time, was set to that. A test that paused for more than 10 seconds would then see the server drop its waiting connections. The helper now sets a 60-second deadline, so each read waits for the 30-second idle timeout, as before. --- crates/automation/tests/it/control.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/automation/tests/it/control.rs b/crates/automation/tests/it/control.rs index a17f3e1f12..c0645eac0c 100644 --- a/crates/automation/tests/it/control.rs +++ b/crates/automation/tests/it/control.rs @@ -135,11 +135,14 @@ fn is_closed(reader: &mut impl BufRead) -> bool { } /// A server whose `ended` receiver gets `()` each time one of its connections has ended. Its clock stands still, so no -/// connection reaches the authentication deadline: only the client or a refusal ends one. +/// connection reaches the authentication deadline: only the client or a refusal ends one. The frozen clock does not +/// stop the socket's read timeout, which runs on real time and is the time left to the deadline capped at the idle +/// timeout. The deadline is a minute, so a waiting connection's read times out after the 30-second idle timeout +/// instead of after 10 seconds. fn serve_counting_ends() -> (Receiver, server::Listening, Receiver<()>) { let (ended, connection_ended) = channel(); let start = motion::now(); - let options = ServeOptions { clock: Arc::new(move || start), ended: Some(ended), ..ServeOptions::default() }; + let options = ServeOptions { auth_deadline: Duration::from_secs(60), clock: Arc::new(move || start), ended: Some(ended) }; let (rx, server) = server::serve_with(TcpListener::bind("127.0.0.1:0").expect("bound"), TOKEN.into(), host(), options).expect("started"); (rx, server, connection_ended) }