Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore][receiver/awsxray] Enable goleak checks #32402

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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