fix: deflake windows endpoint flush drain test (#4021)

The polling peer drains at production's 2ms Windows read cadence, so a 1 MiB
frame took ~5.5s locally and exceeded the test's 10s flush deadline under CI
load. Use a 256 KiB frame, still well above the 64 KiB batch limit, and a 30s
deadline so the assertion no longer depends on CI scheduling.
This commit is contained in:
JJ Liebig
2026-09-13 04:17:50 +04:00
committed by GitHub
parent aa6b531a42
commit 3b9f58b70e
+5 -3
View File
@@ -373,16 +373,18 @@ mod tests {
done.send((first, second)).unwrap();
});
let input = ClientMessage::Input {
data: vec![b'x'; 1024 * 1024],
// Comfortably above MAX_BATCH_BYTES, but small enough that the polling peer's
// Windows 2ms read cadence drains it well within the flush deadline under CI load.
data: vec![b'x'; 256 * 1024],
};
transport.send(&input).unwrap();
transport.send(&ClientMessage::Detach).unwrap();
// Large-frame correctness must not depend on the registry's short exit grace period.
transport
.flush(Instant::now() + Duration::from_secs(10))
.flush(Instant::now() + Duration::from_secs(30))
.unwrap();
drop(transport);
let (first, second) = received.recv_timeout(Duration::from_secs(10)).unwrap();
let (first, second) = received.recv_timeout(Duration::from_secs(30)).unwrap();
assert_eq!(first, input);
assert_eq!(second, ClientMessage::Detach);
reader.join().unwrap();