From 4e8334662561b187cdba17e73a0173526cbf9e39 Mon Sep 17 00:00:00 2001 From: pirumu Date: Wed, 15 Jul 2026 12:01:51 +0700 Subject: [PATCH] =?UTF-8?q?test(proxy):=20spawn=20bash,=20not=20sh,=20in?= =?UTF-8?q?=20signal=20tests=20=E2=80=94=20exec=20-a=20is=20a=20bashism?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /bin/sh is dash on Ubuntu CI; dash rejects 'exec -a' so the marked sleep child exits before it ever appears, failing wait_for_match on every run. The earlier poll fix (6d696e2) addressed a different symptom; this is the actual cause of the red test job. --- crates/hoangsa-proxy/tests/signal_handler.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/hoangsa-proxy/tests/signal_handler.rs b/crates/hoangsa-proxy/tests/signal_handler.rs index 3e3aaec..df1d11b 100644 --- a/crates/hoangsa-proxy/tests/signal_handler.rs +++ b/crates/hoangsa-proxy/tests/signal_handler.rs @@ -74,11 +74,13 @@ fn kill_pid(pid: u32, sig: &str) { fn sigterm_on_hsp_kills_child() { // Sentinel: a unique marker in the sleep cmdline so pgrep can spot // only our child, not other sleeps on the machine. + // `exec -a` is a bashism — /bin/sh is dash on Ubuntu, where it fails + // and the child exits before ever appearing. Spawn bash explicitly. let marker = format!("hsp-sigterm-test-{}", std::process::id()); let script = format!("exec -a {marker} sleep 60"); let mut hsp = Command::new(hsp_bin()) - .args(["run", "sh", "-c", &script]) + .args(["run", "bash", "-c", &script]) .stdin(Stdio::null()) .stdout(Stdio::null()) .stderr(Stdio::null()) @@ -103,7 +105,7 @@ fn sigint_on_hsp_kills_child() { let script = format!("exec -a {marker} sleep 60"); let mut hsp = Command::new(hsp_bin()) - .args(["run", "sh", "-c", &script]) + .args(["run", "bash", "-c", &script]) .stdin(Stdio::null()) .stdout(Stdio::null()) .stderr(Stdio::null())