Files
TradarrV2/backend/cmd/e2e/parent_death_linux.go
Blomios 4459a81206 test(e2e): add isolated browser journey and cleanup supervision
Add a fake-only end-to-end stack, Firefox journey, and bounded process cleanup for normal, failed, and interrupted runs.

Refs #12

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-20 23:39:02 +01:00

24 lines
519 B
Go

//go:build linux
package main
import (
"errors"
"os"
"syscall"
)
// Arm the signal after NotifyContext, before creating any resources. Unlike a
// shell trap, Linux delivers it even when the CLI parent is killed with SIGKILL.
func guardParentDeath() error {
parent := os.Getppid()
_, _, errno := syscall.RawSyscall6(syscall.SYS_PRCTL, 1, uintptr(syscall.SIGTERM), 0, 0, 0, 0)
if errno != 0 {
return errno
}
if os.Getppid() != parent {
return errors.New("E2E parent exited during setup")
}
return nil
}