From 094f9ceab168d09c1b9df4a255ded498c223f9a2 Mon Sep 17 00:00:00 2001 From: TheGeneralist <180094941+thegeneralist01@users.noreply.github.com> Date: Fri, 9 Oct 2026 22:50:32 +0200 Subject: [PATCH] test: make the accepted stub socket blocking on macOS Accepted sockets inherit the listener's non-blocking mode on BSD/macOS, so the synchronous request read in the capture title stub could hit WouldBlock before the client wrote its bytes. Co-Authored-By: Claude Haiku 5.5 --- crates/archivr-server/src/routes.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/archivr-server/src/routes.rs b/crates/archivr-server/src/routes.rs index daea862..b00c215 100644 --- a/crates/archivr-server/src/routes.rs +++ b/crates/archivr-server/src/routes.rs @@ -4280,8 +4280,12 @@ mod tests { Err(error) => panic!("stub accept failed: {error}"), } }; + // BSD/macOS accepted sockets inherit the listener's non-blocking mode. stream - .set_read_timeout(Some(Duration::from_secs(5))) + .set_nonblocking(false) + .expect("stub stream must be blocking for synchronous reads"); + stream + .set_read_timeout(Some(Duration::from_secs(10))) .unwrap(); let mut bytes = Vec::new(); let mut chunk = [0; 4096];