e2e: make e2e tests runnable on !linux (#651)

This commit is contained in:
Josh Bleecher Snyder 2025-08-30 09:59:29 -07:00 committed by GitHub
parent 89ab72bee0
commit 85d1e1a5fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 2 deletions

View file

@ -13,7 +13,6 @@ import (
"os/exec" "os/exec"
"strconv" "strconv"
"strings" "strings"
"syscall"
"testing" "testing"
"time" "time"
@ -59,7 +58,7 @@ func runCmd(cmd string, args ...string) (*exec.Cmd, io.Writer, io.Reader, error)
newargs := append([]string{cmd}, args...) newargs := append([]string{cmd}, args...)
newargs = append([]string{"-i0", "-o0", "-e0"}, newargs...) newargs = append([]string{"-i0", "-o0", "-e0"}, newargs...)
c := exec.Command("stdbuf", newargs...) c := exec.Command("stdbuf", newargs...)
c.SysProcAttr = &syscall.SysProcAttr{Pdeathsig: syscall.SIGTERM} c.SysProcAttr = sigtermForPdeathsig
f, err := pty.Start(c) f, err := pty.Start(c)
if err != nil { if err != nil {
return nil, nil, nil, err return nil, nil, nil, err

View file

@ -0,0 +1,9 @@
//go:build linux
package e2e_test
import (
"syscall"
)
var sigtermForPdeathsig = &syscall.SysProcAttr{Pdeathsig: syscall.SIGTERM}

View file

@ -0,0 +1,9 @@
//go:build !linux
package e2e_test
import (
"syscall"
)
var sigtermForPdeathsig *syscall.SysProcAttr