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>
This commit is contained in:
23
backend/cmd/e2e/parent_death_linux.go
Normal file
23
backend/cmd/e2e/parent_death_linux.go
Normal file
@ -0,0 +1,23 @@
|
||||
//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
|
||||
}
|
||||
Reference in New Issue
Block a user