mirror of https://github.com/golang/go.git
os/exec: fix test hang
Currently the test closes random files descriptors, which leads to hang (in particular if netpoll fd is closed). Try to open only fd 3, since the parent process expects it to be fd 3 anyway. Fixes #5571. R=golang-dev, r CC=golang-dev https://golang.org/cl/9778048
This commit is contained in:
parent
2f5825d427
commit
4d6bfcf245
|
|
@ -540,13 +540,11 @@ func TestHelperProcess(*testing.T) {
|
|||
n, _ := strconv.Atoi(args[0])
|
||||
os.Exit(n)
|
||||
case "describefiles":
|
||||
for fd := uintptr(3); fd < 25; fd++ {
|
||||
f := os.NewFile(fd, fmt.Sprintf("fd-%d", fd))
|
||||
ln, err := net.FileListener(f)
|
||||
if err == nil {
|
||||
fmt.Printf("fd%d: listener %s\n", fd, ln.Addr())
|
||||
ln.Close()
|
||||
}
|
||||
f := os.NewFile(3, fmt.Sprintf("fd3"))
|
||||
ln, err := net.FileListener(f)
|
||||
if err == nil {
|
||||
fmt.Printf("fd3: listener %s\n", ln.Addr())
|
||||
ln.Close()
|
||||
}
|
||||
os.Exit(0)
|
||||
case "extraFilesAndPipes":
|
||||
|
|
|
|||
Loading…
Reference in New Issue