From 3da292008cbb130a58f38e2ae793ac96e1221102 Mon Sep 17 00:00:00 2001 From: "kitokey-marc[bot]" <356215105+kitokey-marc[bot]@users.noreply.github.com> Date: Sun, 15 Nov 2026 00:45:34 +0100 Subject: [PATCH 1/2] shell: a cancelled transcription's deaf child is waited for as gone, not checked the instant it is answered (#845) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The KILL sent, the child is gone once the kernel has delivered it and reaped it: on a loaded runner, after the answer (#812's CI, run 43596085957). Now polled as a state for half a second after the answer; the two seconds' bound kept on the answer itself, read before. Without the group's KILL, it still fails: « still runs half a second after the answer ». Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948 Co-Authored-By: Claude Opus 5.5 --- modules/shell/tests/transcription.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/shell/tests/transcription.rs b/modules/shell/tests/transcription.rs index 3ba3de6d..963619ae 100644 --- a/modules/shell/tests/transcription.rs +++ b/modules/shell/tests/transcription.rs @@ -341,9 +341,16 @@ sleep 60"#, let pressed = std::time::Instant::now(); transcription.cancel(); let ended = said.recv_timeout(Duration::from_secs(2)).expect("not ended within two seconds"); + let answered = pressed.elapsed(); assert!(matches!(ended, Made::Failed(_)), "{ended:?}"); - assert!(gone(&child), "its child, deaf to TERM, still runs"); - assert!(pressed.elapsed() <= Duration::from_secs(2)); + assert!(answered <= Duration::from_secs(2), "{answered:?}"); + // The KILL sent, the child is gone once the kernel has delivered it and the process is reaped: + // a moment after the answer on a loaded machine (#845). Waited for as a state, within half a second. + let killed = std::time::Instant::now(); + while !gone(&child) && killed.elapsed() < Duration::from_millis(500) { + std::thread::sleep(Duration::from_millis(10)); + } + assert!(gone(&child), "its child, deaf to TERM, still runs half a second after the answer"); } #[test] From a44408aff2c69e1606642cf79122959655f588de Mon Sep 17 00:00:00 2001 From: "kitokey-marc[bot]" <356215105+kitokey-marc[bot]@users.noreply.github.com> Date: Sun, 15 Nov 2026 04:08:42 +0100 Subject: [PATCH 2/2] shell: a transcript ended by Kitokey waits for its child gone, as the cancelled one does (#845) The same race, in a_transcript_ended_by_kitokey_ends_with_what_it_started_and_is_not_written: its child checked the instant the answer came, with `kill -0`, which a zombie not yet reaped still answers. It failed #851's attest and #836's. Now waited for with `gone`, zombie-aware, within half a second. Without the group's KILL in `end`, it still fails. Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948 Co-Authored-By: Claude Opus 5.5 --- modules/shell/tests/transcription.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/shell/tests/transcription.rs b/modules/shell/tests/transcription.rs index 963619ae..44641049 100644 --- a/modules/shell/tests/transcription.rs +++ b/modules/shell/tests/transcription.rs @@ -102,7 +102,17 @@ fn a_transcript_ended_by_kitokey_ends_with_what_it_started_and_is_not_written() assert!(alive(&child)); transcription.end(); assert_eq!(end(&said), Made::Failed(String::new())); - assert!(!alive(&child), "what the program started is left running"); + // Its group killed, the child is gone once the KILL is delivered and it is reaped — by the + // system, its parent gone: a moment after the answer on a loaded machine, a zombie meanwhile, + // which `kill -0` still finds (#845). Waited for as a state, within half a second. + let killed = std::time::Instant::now(); + while !gone(&child) && killed.elapsed() < Duration::from_millis(500) { + std::thread::sleep(Duration::from_millis(10)); + } + assert!( + gone(&child), + "what the program started is left running half a second after the answer" + ); assert!(!folder.path().join("session/transcript.jsonl").exists()); }