From 16eeedffaac04073e8f45a366a991798001906ce Mon Sep 17 00:00:00 2001 From: Piotr Tabor Date: Tue, 22 Sep 2020 09:27:58 +0200 Subject: [PATCH] pkg/testutil: Fixing flakes due to >>leak" text/template/parse goroutines. Examplar flake: https://travis-ci.com/github/etcd-io/etcd/jobs/388806782 ``` go test -timeout=5m -cpu=1 --run=Example ./client/... ok go.etcd.io/etcd/v3/client 0.085s testing: warning: no tests to run PASS Unexpected goroutines running after all test(s). 1 instances of: text/template/parse.(*lexer).emit(...) /usr/local/go/src/text/template/parse/lex.go:157 text/template/parse.lexText(...) /usr/local/go/src/text/template/parse/lex.go:269 +0x4f0 text/template/parse.(*lexer).run(...) /usr/local/go/src/text/template/parse/lex.go:230 +0x37 created by text/template/parse.lex /usr/local/go/src/text/template/parse/lex.go:223 +0x190 FAIL go.etcd.io/etcd/v3/client/integration 0.013s ``` --- pkg/testutil/leak.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/testutil/leak.go b/pkg/testutil/leak.go index 77fce27e7..546ab05da 100644 --- a/pkg/testutil/leak.go +++ b/pkg/testutil/leak.go @@ -131,6 +131,7 @@ func interestingGoroutines() (gs []string) { strings.Contains(stack, "go.etcd.io/etcd/v3/pkg/logutil.(*MergeLogger).outputLoop") || strings.Contains(stack, "github.com/golang/glog.(*loggingT).flushDaemon") || strings.Contains(stack, "created by runtime.gc") || + strings.Contains(stack, "created by text/template/parse.lex") || strings.Contains(stack, "runtime.MHeap_Scavenger") { continue }