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>
24 lines
519 B
Go
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
|
|
}
|