From 04a8e2b328a1f189f8d41b4784af9770e00b65a9 Mon Sep 17 00:00:00 2001 From: damocles Date: Thu, 8 Oct 2026 02:01:04 +0200 Subject: [PATCH] hive-subagent-mcp: write the fake-claude test script via write_executable --- hive-subagent-mcp/src/session.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/hive-subagent-mcp/src/session.rs b/hive-subagent-mcp/src/session.rs index 8466f8a0..d8d09ed8 100644 --- a/hive-subagent-mcp/src/session.rs +++ b/hive-subagent-mcp/src/session.rs @@ -3578,18 +3578,14 @@ mod tests { /// EOF, so `RunningClaude::wait` would not return until the orphaned /// sleep expired, and the turn would look like it was still running. fn fake_claude(dir: &Path, log: &Path) -> PathBuf { - use std::os::unix::fs::PermissionsExt as _; let script = dir.join("fake-claude"); - std::fs::write( + write_executable( &script, - format!( + &format!( "#!/bin/sh\necho turn >> '{}'\ntrap 'exit 0' INT\nsleep 30 >/dev/null 2>&1 &\nwait\n", log.display() ), - ) - .expect("write the fake claude"); - std::fs::set_permissions(&script, std::fs::Permissions::from_mode(0o755)) - .expect("make the fake claude executable"); + ); script }