diff --git a/pkg/command/process_test.go b/pkg/command/process_test.go index ab8948a3c9..dfc50a60e2 100644 --- a/pkg/command/process_test.go +++ b/pkg/command/process_test.go @@ -315,7 +315,13 @@ func startSigtermIgnoringGroup(t *testing.T) *exec.Cmd { t.Helper() ready := filepath.Join(t.TempDir(), "ready") // #nosec G204 -- the fixed shell script and all paths are test-controlled. - cmd := exec.Command("sh", "-c", `trap '' TERM; printf 'ready\n' > "$1"; sleep 30`, "sh", ready) + cmd := exec.Command( + "sh", + "-c", + `trap '' TERM; printf 'ready\n' > "$1"; exec sleep 30`, + "sh", + ready, + ) cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} if err := cmd.Start(); err != nil { t.Fatalf("start SIGTERM-ignoring group: %v", err)