Skip to content

Commit 7e22012

Browse files
crobert-1cparkins
authored andcommitted
[chore][pkg/stanza/adapter] Enable goleak check (open-telemetry#30969)
1 parent 0033ddd commit 7e22012

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

pkg/stanza/adapter/integration_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ func TestEmitterToConsumer(t *testing.T) {
110110

111111
err = logsReceiver.Start(context.Background(), componenttest.NewNopHost())
112112
require.NoError(t, err)
113+
defer func() { require.NoError(t, logsReceiver.Shutdown(context.Background())) }()
113114

114115
go func() {
115116
ctx := context.Background()

pkg/stanza/adapter/package_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package adapter
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}

pkg/stanza/adapter/storage_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ func TestFindCorrectStorageExtension(t *testing.T) {
7777
err := r.Start(context.Background(), host)
7878
require.NoError(t, err)
7979
require.NotNil(t, r.storageClient)
80+
defer func() { require.NoError(t, r.Shutdown(context.Background())) }()
8081

8182
clientCreatorID, err := storagetest.CreatorID(context.Background(), r.storageClient)
8283
require.NoError(t, err)

0 commit comments

Comments
 (0)