brokerd tests: read the final frame after the handler closes, on macOS
The test client set its read timeout before every frame. On macOS that
fails with EINVAL once the handler has sent its final frame and closed,
so every admin test that reads a second frame failed there (40 runs of
40 at 2408e2c). The frame is already buffered, so the client now takes
that one refusal as the peer having closed and reads it. The plan's copy
changes with it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -53,11 +53,13 @@ pub fn open(
|
||||
client
|
||||
}
|
||||
|
||||
/// The next frame, waiting at most ten seconds.
|
||||
/// The next frame, waiting at most ten seconds. Once the handler has closed its end, macOS
|
||||
/// refuses the timeout with EINVAL (22); the frame is buffered by then and the read cannot block.
|
||||
pub fn next(stream: &mut UnixStream) -> Envelope {
|
||||
stream
|
||||
.set_read_timeout(Some(Duration::from_secs(10)))
|
||||
.unwrap();
|
||||
if let Err(e) = stream.set_read_timeout(Some(Duration::from_secs(10))) {
|
||||
let peer_closed = cfg!(target_vendor = "apple") && e.raw_os_error() == Some(22);
|
||||
assert!(peer_closed, "set_read_timeout: {e}");
|
||||
}
|
||||
proto::read_frame(stream).unwrap()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user