From 78151ffcccd43193cc74a4b617998de08355b099 Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Mon, 10 Aug 2026 23:19:40 +0700 Subject: [PATCH] docs(cli-tests): document why SIGINT gates on reply-sent, not consumed continuous_single_target_interruption_drains_final_events_and_succeeds intentionally allows SIGINT as soon as the fake server has sent its reply, even if the managed client hasn't consumed it yet. The echo_reply assertion is what proves shutdown drains a still-queued reply instead of losing it; gating on client-side consumption would remove the in-flight scenario the test exists to cover. --- crates/irtt-cli/tests/client_multi_target.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/irtt-cli/tests/client_multi_target.rs b/crates/irtt-cli/tests/client_multi_target.rs index 2f3d732..c8ab20d 100644 --- a/crates/irtt-cli/tests/client_multi_target.rs +++ b/crates/irtt-cli/tests/client_multi_target.rs @@ -203,6 +203,11 @@ fn continuous_single_target_interruption_drains_final_events_and_succeeds() { .stderr(Stdio::piped()) .spawn() .unwrap(); + // Only wait for the reply to be sent, not consumed: whether the client + // has already read it or it is still in flight when SIGINT lands is the + // scenario this test exercises. The echo_reply assertion below is what + // proves shutdown drains a reply that was still queued at interrupt time + // rather than losing it. server.wait_until_first_reply_sent(); let signal_status = Command::new("kill") .args(["-INT", &child.id().to_string()])