1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-12-04 18:56:44 +01:00

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 <noreply@anthropic.com>
This commit is contained in:
TheGeneralist 2026-10-09 22:50:32 +02:00
parent 848f1b1e56
commit 094f9ceab1

View file

@ -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];