-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore][receiver/googlecloudpubsubreceiver/internal] Enable goleak ch…
…eck (#32311) Enable `goleak` checks inside the `internal` package of the Google Cloud PubSub receiver to help ensure no goroutines are leaking. This is a test only change, some closes/cancels were missing. Also, we need to pass a context to the grpc dial functionality, so switch from`Dial` -> `DialContext`. `Dial` is a wrapper for `DialContext` passing in `context.Background()`. **Link to tracking Issue:** #30438 Existing tests are passing, as well as added `goleak` check.
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
receiver/googlecloudpubsubreceiver/internal/package_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package internal | ||
|
||
import ( | ||
"testing" | ||
|
||
"go.uber.org/goleak" | ||
) | ||
|
||
// See https://github.com/census-instrumentation/opencensus-go/issues/1191 for more information on ignore. | ||
func TestMain(m *testing.M) { | ||
goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start")) | ||
} |