diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2013-05-28 21:09:27 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2013-05-28 21:09:27 +0400 |
| commit | 4d6bfcf24504bb2de0bf63bf43ad703ba808a3e9 (patch) | |
| tree | 3e67e0f400741b29137b8deb8007443a91b76492 /src/pkg | |
| parent | 2f5825d4273d910b0d3c9ee82336cf041e8f02d3 (diff) | |
| download | go-4d6bfcf24504bb2de0bf63bf43ad703ba808a3e9.tar.xz | |
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
Diffstat (limited to 'src/pkg')
| -rw-r--r-- | src/pkg/os/exec/exec_test.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/pkg/os/exec/exec_test.go b/src/pkg/os/exec/exec_test.go index 6f5860e955..eae9fb1441 100644 --- a/src/pkg/os/exec/exec_test.go +++ b/src/pkg/os/exec/exec_test.go @@ -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": |
