From 6edc57983a39b3cb911ea88b75a7ad39664383ec Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 8 Sep 2021 16:21:33 -0700 Subject: [PATCH] internal/poll: report open fds when TestSplicePipePool fails For #48066 Change-Id: I1152a1c15756df35b71b27d3e7025d97da9e70b0 Reviewed-on: https://go-review.googlesource.com/c/go/+/348579 Trust: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Go Bot Reviewed-by: Emmanuel Odeke --- src/internal/poll/splice_linux_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/internal/poll/splice_linux_test.go b/src/internal/poll/splice_linux_test.go index 280468c7e7..deac5c3759 100644 --- a/src/internal/poll/splice_linux_test.go +++ b/src/internal/poll/splice_linux_test.go @@ -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: } -- 2.50.0