Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Code

527 commit(s) on main

Put job execution behind an interface Keenan Nemetz · 2h ago de3eec16
history blame raw 659 B
1//go:build unix
2
3package server_test
4
5import (
6 "os/exec"
7 "syscall"
8)
9
10// ownProcessGroup puts the runner under test in its own process group, so the
11// cleanup below can kill the runner and everything it started. Without it, a
12// killed test leaves containers or build steps behind.
13func ownProcessGroup(cmd *exec.Cmd) {
14 cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
15}
16
17// killRunnerTree kills the runner's process group. A negative pid names the
18// group; the process is then reaped by the caller's Wait.
19func killRunnerTree(cmd *exec.Cmd) error {
20 if cmd.Process == nil {
21 return nil
22 }
23 return syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
24}
25