Artifact 84a31d9afb90f92219ca5ffb6d0eec48f3fd68ef37797c38eab22a5dbe0dc9d2:
- File
testutil/server_other.go
— part of check-in
[bb864e6c58]
at
2026-10-13 00:48:23
on branch main
— fix(test): kill fossil server's process group before cleanup (#352) (#365)
Start fossil server in its own process group through a shared testutil.StartServer helper and SIGKILL the whole group before Wait, so forked per-connection children cannot write into t.TempDir() during cleanup. Tracked in #352. (user: [email protected], size: 626) [annotate] [blame] [check-ins using]
//go:build !unix package testutil import ( "os" "os/exec" "testing" ) // StartServer is the non-unix fallback: no process groups, so only the parent // is killed and reaped. The #352 race therefore remains on these platforms. func StartServer(t *testing.T, bin string, args ...string) *exec.Cmd { t.Helper() if bin == "" { panic("testutil.StartServer: empty bin") } cmd := exec.Command(bin, args...) cmd.Stdout = os.Stderr cmd.Stderr = os.Stderr if err := cmd.Start(); err != nil { t.Fatalf("start %s %v: %v", bin, args, err) } t.Cleanup(func() { _ = cmd.Process.Kill() _ = cmd.Wait() }) return cmd }