Skip to content

Commit

Permalink
[chore][receiver/snowflake] Enable goleak checks
Browse files Browse the repository at this point in the history
  • Loading branch information
crobert-1 committed Apr 4, 2024
1 parent eb308a9 commit 5c09feb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
5 changes: 3 additions & 2 deletions receiver/snowflakereceiver/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

func TestDefaultClientCreation(t *testing.T) {
_, err := newDefaultClient(componenttest.NewNopTelemetrySettings(), Config{
c, err := newDefaultClient(componenttest.NewNopTelemetrySettings(), Config{
Username: "testuser",
Password: "testPassword",
Account: "testAccount",
Expand All @@ -27,7 +27,8 @@ func TestDefaultClientCreation(t *testing.T) {
Database: "testDatabase",
Role: "testRole",
})
assert.Equal(t, nil, err)
assert.NoError(t, err)
assert.NoError(t, c.client.Close())
}

// test query wrapper
Expand Down
14 changes: 14 additions & 0 deletions receiver/snowflakereceiver/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 snowflakereceiver

import (
"testing"

"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}
1 change: 1 addition & 0 deletions receiver/snowflakereceiver/scraper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func TestStart(t *testing.T) {
scraper := newSnowflakeMetricsScraper(receivertest.NewNopCreateSettings(), cfg)
err := scraper.start(context.Background(), componenttest.NewNopHost())
require.NoError(t, err, "Problem starting scraper")
require.NoError(t, scraper.shutdown(context.Background()))
}

// wrapper type for convenience
Expand Down

0 comments on commit 5c09feb

Please sign in to comment.