Skip to content

Commit

Permalink
[chore][receiver/awsxray] Enable goleak checks
Browse files Browse the repository at this point in the history
  • Loading branch information
crobert-1 committed Apr 15, 2024
1 parent 709e168 commit 0913fe9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions receiver/awsxrayreceiver/internal/udppoller/package_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package udppoller

import (
"testing"

"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}
3 changes: 3 additions & 0 deletions receiver/awsxrayreceiver/internal/udppoller/poller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ func TestSocketReadIrrecoverableNetError(t *testing.T) {
}

p.Start(context.Background())
defer func() { assert.NoError(t, p.Close()) }()

assert.Eventuallyf(t, func() bool {
logs := recordedLogs.All()
Expand Down Expand Up @@ -328,6 +329,7 @@ func TestSocketReadTimeOutNetError(t *testing.T) {
}

p.Start(context.Background())
defer func() { assert.NoError(t, p.Close()) }()

assert.Eventuallyf(t, func() bool {
logs := recordedLogs.All()
Expand Down Expand Up @@ -363,6 +365,7 @@ func TestSocketGenericReadError(t *testing.T) {
}

p.Start(context.Background())
defer func() { assert.NoError(t, p.Close()) }()

assert.Eventuallyf(t, func() bool {
logs := recordedLogs.All()
Expand Down

0 comments on commit 0913fe9

Please sign in to comment.