From 5ee89be6164670485b2342419384ae5f35ed2922 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Wed, 12 Jul 2017 14:04:24 -0700 Subject: [PATCH] testutil: whitelist WaitGroup.Done Calling a WaitGroup.Done() in a defer will sometimes trigger the leak detector since the WaitGroup.Wait() will unblock before the defer block completes. If the leak detector runs before the Done() is rescheduled, it will spuriously report the finishing Done() as a leak. This happens enough in CI to be irritating; whitelist it and ignore. --- pkg/testutil/leak.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/testutil/leak.go b/pkg/testutil/leak.go index 12d4408e329..a29d06d9bd0 100644 --- a/pkg/testutil/leak.go +++ b/pkg/testutil/leak.go @@ -118,6 +118,7 @@ func interestingGoroutines() (gs []string) { } stack := strings.TrimSpace(sl[1]) if stack == "" || + strings.Contains(stack, "sync.(*WaitGroup).Done") || strings.Contains(stack, "created by os/signal.init") || strings.Contains(stack, "runtime/panic.go") || strings.Contains(stack, "created by testing.RunTests") ||