From 08a80697d3e99951f4c662b14e7f2895d5e84d05 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 7 Nov 2026 03:16:27 +0100 Subject: [PATCH] self_run tests: the fake claude scripts that loop end when their stdin closes Co-Authored-By: Claude Sonnet 5.5 --- crates/mind-body/src/self_run/tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/mind-body/src/self_run/tests.rs b/crates/mind-body/src/self_run/tests.rs index 2b204b7..c47e3e7 100644 --- a/crates/mind-body/src/self_run/tests.rs +++ b/crates/mind-body/src/self_run/tests.rs @@ -1011,7 +1011,7 @@ mod process { #[test] fn interrupt_is_sigint_the_childs_own_handler_can_catch() { let dir = tempfile::tempdir().unwrap(); - let program = script(&dir, "trap 'echo interrupted; exit 130' INT\necho ready\nwhile :; do sleep 0.05; done"); + let program = script(&dir, "trap 'echo interrupted; exit 130' INT\necho ready\nwhile :; do read -t 0.05 -r _; [ $? -le 128 ] && break; done"); let mut child = start(&program, &[]); assert_eq!(child.next(StdDuration::from_secs(20)), Read::Line("ready".into())); child.stop(Stop::Interrupt); @@ -1154,7 +1154,7 @@ result subtype=success is_error=false: The answer. #[test] fn each_signal_reaches_a_child_that_ignores_the_weaker_ones_and_one_for_a_gone_child_is_not_delivered() { let dir = tempfile::tempdir().unwrap(); - let program = script(&dir, "trap '' INT TERM\necho ready\nwhile :; do sleep 0.05; done"); + let program = script(&dir, "trap '' INT TERM\necho ready\nwhile :; do read -t 0.05 -r _; [ $? -le 128 ] && break; done"); let mut child = start(&program, &[]); assert_eq!(child.next(StdDuration::from_secs(20)), Read::Line("ready".into())); assert!(child.stop(Stop::Interrupt) && child.stop(Stop::Terminate), "delivered, and ignored");