Add goroutine leak detection in tests

This commit is contained in:
Vladislav Rassokhin 2019-07-13 18:23:04 +03:00
parent 4cf9ff78a2
commit ddbc7bb631
5 changed files with 27 additions and 0 deletions

8
clone/leak_test.go Normal file
View File

@ -0,0 +1,8 @@
package clone
import "testing"
import "go.uber.org/goleak"
func TestMain(m *testing.M) {
goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"))
}

8
driver/leak_test.go Normal file
View File

@ -0,0 +1,8 @@
package driver
import "testing"
import "go.uber.org/goleak"
func TestMain(m *testing.M) {
goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"))
}

1
go.mod
View File

@ -3,5 +3,6 @@ module github.com/jetbrains-infra/packer-builder-vsphere
require (
github.com/hashicorp/packer v1.4.2
github.com/vmware/govmomi v0.20.0
go.uber.org/goleak v0.10.1-0.20190517053103-3b0196519f16
golang.org/x/mobile v0.0.0-20190607214518-6fa95d984e88
)

2
go.sum
View File

@ -342,6 +342,8 @@ github.com/yandex-cloud/go-sdk v0.0.0-20190402114215-3fc1d6947035/go.mod h1:Eml0
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.uber.org/goleak v0.10.1-0.20190517053103-3b0196519f16 h1:ucZ8P+3HTFz4/kqeQ9Mg0j8F/oHbcaWfKLWiBo3QLKk=
go.uber.org/goleak v0.10.1-0.20190517053103-3b0196519f16/go.mod h1:VCZuO8V8mFPlL0F5J5GK1rtHV3DrFcQ1R8ryq7FK0aI=
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=

8
iso/leak_test.go Normal file
View File

@ -0,0 +1,8 @@
package iso
import "testing"
import "go.uber.org/goleak"
func TestMain(m *testing.M) {
goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"))
}