Description
We've found an interesting thing during using goleak on our CI, that goleak can detect leaked goroutine from other tests.
Steps to reproduce
- Use go1.14.1 darwin/amd64
- Use goleak v1.0.0
- Run test file below
goleak_test.go
package goleak_test
import (
"go.uber.org/goleak"
"testing"
"time"
)
func TestA(t *testing.T) {
go func() {
for {
<-time.After(time.Millisecond * 100)
}
}()
}
func TestB(t *testing.T) {
defer goleak.VerifyNone(t)
}
Expected: TestB should pass
Actual: TestB fails with error "found unexpected goroutines:"