]> Cypherpunks repositories - gostls13.git/commitdiff
os/exec: for TestExtraFiles failure, print readlink of unexpected fd
authorIan Lance Taylor <iant@golang.org>
Tue, 24 Mar 2020 20:13:38 +0000 (13:13 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 24 Mar 2020 22:21:50 +0000 (22:21 +0000)
For #25628

Change-Id: If1dce7ba9310e1418e67b9954c989471b775a28e
Reviewed-on: https://go-review.googlesource.com/c/go/+/225278
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/os/exec/exec_test.go

index dce66c5c2e184f74d3143c64ea9b77d1727f05ec..91dd0a41acf66e3db0fbbe0e20e2982f46fdbfac 100644 (file)
@@ -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":