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:
2026-09-22 18:28:18 -07:00
co-authored by Claude Opus 5.5
parent 00a85c124d
commit d7009dc488
2 changed files with 12 additions and 8 deletions
+6 -4
View File
@@ -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()
}