From c50f3ee97006cccf7febfd9b890efa73e919548b Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 29 Sep 2026 23:56:57 +0800 Subject: [PATCH] fix: restore blocking mode on accepted mock sockets on Windows Accepted sockets inherit the listener's non-blocking mode on Windows, so read_line returned WouldBlock instead of waiting for the read timeout; all dynamic_channels integration tests panicked. --- tests/dynamic_channels.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/dynamic_channels.rs b/tests/dynamic_channels.rs index 1cdd287..cb1e258 100644 --- a/tests/dynamic_channels.rs +++ b/tests/dynamic_channels.rs @@ -94,6 +94,9 @@ impl MockSession { Err(error) => panic!("accept failed: {error}"), } }; + // Windows: accepted sockets inherit the listener's non-blocking mode; + // restore blocking reads so read timeouts work on every platform. + socket.set_nonblocking(false).unwrap(); socket.set_read_timeout(Some(WAIT)).unwrap(); socket.set_write_timeout(Some(WAIT)).unwrap(); self.socket = Some(BufReader::new(socket));