diff --git a/crates/fbuild-cli/src/cli/port_scan.rs b/crates/fbuild-cli/src/cli/port_scan.rs index 6c0d6eac2..648bd93c4 100644 --- a/crates/fbuild-cli/src/cli/port_scan.rs +++ b/crates/fbuild-cli/src/cli/port_scan.rs @@ -520,6 +520,18 @@ mod tests { while request_count < 2 { match listener.accept() { Ok((mut stream, _)) => { + // Windows hands back an accepted socket that inherits + // the listener's non-blocking mode, unlike Unix. The + // read below then returns WSAEWOULDBLOCK (os error + // 10035) whenever the client's bytes have not landed + // yet, and `unwrap` turns that into a flaky failure + // that looks nothing like a socket-mode problem. + // FastLED/fbuild#1349 CI run 32658416728 hit it; the + // mock daemon in `test_emu_exit_code.rs` already + // guards the same way. + stream + .set_nonblocking(false) + .expect("accepted socket must block for the exchange below"); let mut request = [0_u8; 1024]; let _ = stream.read(&mut request).unwrap(); request_count += 1; diff --git a/crates/fbuild-core/src/usb/data.rs b/crates/fbuild-core/src/usb/data.rs index b593ca4a5..e64c241d5 100644 --- a/crates/fbuild-core/src/usb/data.rs +++ b/crates/fbuild-core/src/usb/data.rs @@ -639,6 +639,18 @@ mod tests { while request_count < 2 { match listener.accept() { Ok((mut stream, _)) => { + // Windows hands back an accepted socket that inherits + // the listener's non-blocking mode, unlike Unix. The + // read below then returns WSAEWOULDBLOCK (os error + // 10035) whenever the client's bytes have not landed + // yet, and `unwrap` turns that into a flaky failure + // that looks nothing like a socket-mode problem. + // FastLED/fbuild#1349 CI run 32658416728 hit it; the + // mock daemon in `test_emu_exit_code.rs` already + // guards the same way. + stream + .set_nonblocking(false) + .expect("accepted socket must block for the exchange below"); let mut buf = [0_u8; 1024]; let _ = stream.read(&mut buf).unwrap(); request_count += 1;