From bb42d2b40e7e40d1aec39d25fb926f2d77cb4ca1 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Wed, 19 Jul 2017 13:28:15 -0700 Subject: [PATCH] testutil: whitelist os.(*file).close Leak detector is catching goroutines trying to close files which appear runtime related: 1 instances of: syscall.Syscall(...) /usr/local/golang/1.8.3/go/src/syscall/asm_linux_386.s:20 +0x5 syscall.Close(...) /usr/local/golang/1.8.3/go/src/syscall/zsyscall_linux_386.go:296 +0x3d os.(*file).close(...) /usr/local/golang/1.8.3/go/src/os/file_unix.go:140 +0x62 It's unlikely a user goroutine will leak on file close; whitelist it. --- pkg/testutil/leak.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/testutil/leak.go b/pkg/testutil/leak.go index a29d06d9bd0..3bf7e6b6713 100644 --- a/pkg/testutil/leak.go +++ b/pkg/testutil/leak.go @@ -119,6 +119,7 @@ func interestingGoroutines() (gs []string) { stack := strings.TrimSpace(sl[1]) if stack == "" || strings.Contains(stack, "sync.(*WaitGroup).Done") || + strings.Contains(stack, "os.(*file).close") || strings.Contains(stack, "created by os/signal.init") || strings.Contains(stack, "runtime/panic.go") || strings.Contains(stack, "created by testing.RunTests") ||