Remove goleak usage

This commit is contained in:
Abhishek Pandey 2023-11-06 16:10:11 -08:00
parent 110b477346
commit 969d1fb6b6
3 changed files with 7 additions and 13 deletions

View File

@ -68,7 +68,6 @@ require (
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.48.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.uber.org/goleak v1.3.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
)

View File

@ -470,8 +470,6 @@ go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1
go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo=
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=

View File

@ -11,7 +11,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"go.uber.org/goleak"
"github.com/alcionai/corso/src/internal/tester"
)
@ -24,6 +23,8 @@ func TestSlidingWindowLimiterSuite(t *testing.T) {
suite.Run(t, &SlidingWindowUnitTestSuite{Suite: tester.NewUnitSuite(t)})
}
// TestWaitBasic tests the Wait() functionality of the limiter with multiple
// concurrent requests.
func (suite *SlidingWindowUnitTestSuite) TestWaitBasic() {
var (
t = suite.T()
@ -38,8 +39,6 @@ func (suite *SlidingWindowUnitTestSuite) TestWaitBasic() {
intervalToCount = make(map[time.Duration]int)
)
defer goleak.VerifyNone(t)
ctx, flush := tester.NewContext(t)
defer flush()
@ -79,6 +78,8 @@ func (suite *SlidingWindowUnitTestSuite) TestWaitBasic() {
}
}
// TestWaitSliding tests the sliding window functionality of the limiter with distributed
// Wait() calls.
func (suite *SlidingWindowUnitTestSuite) TestWaitSliding() {
var (
t = suite.T()
@ -90,8 +91,6 @@ func (suite *SlidingWindowUnitTestSuite) TestWaitSliding() {
wg sync.WaitGroup
)
defer goleak.VerifyNone(t)
ctx, flush := tester.NewContext(t)
defer flush()
@ -140,8 +139,6 @@ func (suite *SlidingWindowUnitTestSuite) TestContextCancellation() {
wg sync.WaitGroup
)
defer goleak.VerifyNone(t)
ctx, flush := tester.NewContext(t)
defer flush()
@ -219,11 +216,11 @@ func (suite *SlidingWindowUnitTestSuite) TestNewSlidingWindowLimiter() {
test.windowSize,
test.slideInterval,
test.capacity)
test.expectErr(t, err)
if s != nil {
s.Shutdown()
defer s.Shutdown()
}
test.expectErr(t, err)
})
}
}