]> Cypherpunks repositories - gostls13.git/commitdiff
internal/poll: report open fds when TestSplicePipePool fails
authorIan Lance Taylor <iant@golang.org>
Wed, 8 Sep 2021 23:21:33 +0000 (16:21 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 9 Sep 2021 04:23:56 +0000 (04:23 +0000)
For #48066

Change-Id: I1152a1c15756df35b71b27d3e7025d97da9e70b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/348579
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
src/internal/poll/splice_linux_test.go

index 280468c7e748d85ec957e7a36eac0a8149440f0d..deac5c37596b463eb398f503a506d4aa7689b3fe 100644 (file)
@@ -67,6 +67,13 @@ func TestSplicePipePool(t *testing.T) {
                }
                select {
                case <-expiredTime.C:
+                       t.Logf("descriptors to check: %v", fds)
+                       for _, fd := range fds {
+                               _, _, errno := syscall.Syscall(unix.FcntlSyscall, uintptr(fd), syscall.F_GETPIPE_SZ, 0)
+                               if errno == 0 {
+                                       t.Errorf("descriptor %d still open", fd)
+                               }
+                       }
                        t.Fatal("at least one pipe is still open")
                default:
                }