diff --git a/pkg/stanza/adapter/integration_test.go b/pkg/stanza/adapter/integration_test.go index ec31ff723019..f4a1836e6b38 100644 --- a/pkg/stanza/adapter/integration_test.go +++ b/pkg/stanza/adapter/integration_test.go @@ -110,6 +110,7 @@ func TestEmitterToConsumer(t *testing.T) { err = logsReceiver.Start(context.Background(), componenttest.NewNopHost()) require.NoError(t, err) + defer func() { require.NoError(t, logsReceiver.Shutdown(context.Background())) }() go func() { ctx := context.Background() diff --git a/pkg/stanza/adapter/package_test.go b/pkg/stanza/adapter/package_test.go new file mode 100644 index 000000000000..23f61a5be546 --- /dev/null +++ b/pkg/stanza/adapter/package_test.go @@ -0,0 +1,14 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package adapter + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/pkg/stanza/adapter/storage_test.go b/pkg/stanza/adapter/storage_test.go index 4848edc1629d..419f06986faf 100644 --- a/pkg/stanza/adapter/storage_test.go +++ b/pkg/stanza/adapter/storage_test.go @@ -77,6 +77,7 @@ func TestFindCorrectStorageExtension(t *testing.T) { err := r.Start(context.Background(), host) require.NoError(t, err) require.NotNil(t, r.storageClient) + defer func() { require.NoError(t, r.Shutdown(context.Background())) }() clientCreatorID, err := storagetest.CreatorID(context.Background(), r.storageClient) require.NoError(t, err)