uber-go / goleak

Goroutine leak detector
MIT License
4.48k stars 148 forks source link

goleak.IgnoreAnyFunction not working for rollbar-go #117

Closed sagarrohankar-bsft closed 9 months ago

sagarrohankar-bsft commented 9 months ago

Hi, I'm trying to skip reporting rollbar goroutine like below:

func TestMain(m *testing.M) {
    goleak.IgnoreAnyFunction("github.com/rollbar/rollbar-go.NewAsyncTransport.func1")
    goleak.IgnoreAnyFunction("github.com/rollbar/rollbar-go.NewAsyncTransport")
    goleak.VerifyTestMain(m)
    os.Exit(testMain(m))
}

but it still does report about the leak

=== RUN   TestE2E
Starting E2E test
--- PASS: TestE2E (1.00s)
PASS
goleak: Errors on successful test run: found unexpected goroutines:
[Goroutine 34 in state chan receive, with github.com/rollbar/rollbar-go.NewAsyncTransport.func1 on top of the stack:
github.com/rollbar/rollbar-go.NewAsyncTransport.func1()
    /Users/sagar/go/pkg/mod/github.com/rollbar/rollbar-go@v1.4.5/async_transport.go:74 +0x8a
created by github.com/rollbar/rollbar-go.NewAsyncTransport in goroutine 1
    /Users/sagar/go/pkg/mod/github.com/rollbar/rollbar-go@v1.4.5/async_transport.go:61 +0x198
]
FAIL

What possibly wrong Im doing?