Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkg/command/process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
if err := cmd.Start(); err != nil {
t.Fatalf("start SIGTERM-ignoring group: %v", err)
Expand Down
Loading