Skip to content

Commit

Permalink
[chore][awscloudwatchlogsexporter] Enable goleak check (#31891)
Browse files Browse the repository at this point in the history
Description:
Enables `goleak` checking on the `awscloudwatchlogsexporter` package.

Link to tracking Issue:

#30438

Signed-off-by: Israel Blancas <iblancasa@gmail.com>
  • Loading branch information
iblancasa authored Mar 21, 2024
1 parent 532cb46 commit 8f4639b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions exporter/awscloudwatchlogsexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ require (
go.opentelemetry.io/collector/pdata v1.3.1-0.20240315172937-3b5aee0c7a16
go.opentelemetry.io/otel/metric v1.24.0
go.opentelemetry.io/otel/trace v1.24.0
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
)
Expand Down
17 changes: 17 additions & 0 deletions exporter/awscloudwatchlogsexporter/package_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package awscloudwatchlogsexporter

import (
"testing"

"go.uber.org/goleak"
)

// The IgnoreTopFunction call prevents catching the leak generated by opencensus
// defaultWorker.Start which at this time is part of the package's init call.
// See https://github.com/census-instrumentation/opencensus-go/issues/1191 for more information.
func TestMain(m *testing.M) {
goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"))
}

0 comments on commit 8f4639b

Please sign in to comment.