From: Ian Lance Taylor Date: Tue, 24 Mar 2020 20:13:38 +0000 (-0700) Subject: os/exec: for TestExtraFiles failure, print readlink of unexpected fd X-Git-Tag: go1.15beta1~765 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9f343b1942356e0c87c6994118be298f634e6b4d;p=gostls13.git os/exec: for TestExtraFiles failure, print readlink of unexpected fd For #25628 Change-Id: If1dce7ba9310e1418e67b9954c989471b775a28e Reviewed-on: https://go-review.googlesource.com/c/go/+/225278 Run-TryBot: Ian Lance Taylor Reviewed-by: Bryan C. Mills TryBot-Result: Gobot Gobot --- diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go index dce66c5c2e..91dd0a41ac 100644 --- a/src/os/exec/exec_test.go +++ b/src/os/exec/exec_test.go @@ -861,6 +861,9 @@ func TestHelperProcess(*testing.T) { } if got := f.Fd(); got != wantfd { fmt.Printf("leaked parent file. fd = %d; want %d\n", got, wantfd) + fdfile := fmt.Sprintf("/proc/self/fd/%d", wantfd) + link, err := os.Readlink(fdfile) + fmt.Printf("readlink(%q) = %q, %v\n", fdfile, link, err) var args []string switch runtime.GOOS { case "plan9":