From e1bdd7920e2657fa3f37acee4e871552413be8b2 Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Sat, 15 Aug 2026 01:54:54 +0700 Subject: [PATCH] test(client): compare full event streams before zipping The zip loops stopped at the shorter list, and the sequence helpers filter out everything that is not a probe or reply, so a driver emitting an extra trailing event of another kind would still have passed. Event-list lengths are now asserted before the element-wise comparison. --- crates/irtt-client/src/async_client/tests.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/irtt-client/src/async_client/tests.rs b/crates/irtt-client/src/async_client/tests.rs index 45c9ba2..b9d5620 100644 --- a/crates/irtt-client/src/async_client/tests.rs +++ b/crates/irtt-client/src/async_client/tests.rs @@ -1316,6 +1316,9 @@ fn blocking_and_async_roll_back_a_failed_open_and_accept_a_retry() { assert_eq!(probe_sequences(&async_sent), [0]); assert_eq!(reply_sequences(&blocking_reply), [0]); assert_eq!(reply_sequences(&async_reply), [0]); + assert_eq!(blocking_sent.len(), async_sent.len()); + assert_eq!(blocking_reply.len(), async_reply.len()); + assert_eq!(blocking_close.len(), async_close.len()); assert_matching_event_shape(&blocking_close[0], &async_close[0]); } @@ -1357,6 +1360,10 @@ fn blocking_and_async_complete_every_caller_paced_probe() { assert_eq!(probe_sequences(&async_sent), expected); assert_eq!(reply_sequences(&blocking_replies), expected); assert_eq!(reply_sequences(&async_replies), expected); + // Compare the whole emitted streams, not just the probe and reply events + // the sequence helpers keep: an extra event on either side is a difference. + assert_eq!(blocking_sent.len(), async_sent.len()); + assert_eq!(blocking_replies.len(), async_replies.len()); for (blocking, asynchronous) in blocking_sent.iter().zip(&async_sent) { assert_matching_event_shape(blocking, asynchronous); }