Skip to content

Commit

Permalink
[chore][receiver/pulsar] Enable goleak check (#32195)
Browse files Browse the repository at this point in the history
Enable `goleak` testing on the Pulsar receiver to help ensure no
goroutines are being leaked.

**Link to tracking Issue:** #30438
  • Loading branch information
crobert-1 authored Apr 5, 2024
1 parent ab26ee5 commit e837b08
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions receiver/pulsarreceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ require (
go.opentelemetry.io/collector/semconv v0.97.1-0.20240404121116-4f1a8936d26b
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/zap v1.27.0
)

Expand Down
15 changes: 15 additions & 0 deletions receiver/pulsarreceiver/package_test.go
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 pulsarreceiver

import (
"testing"

"go.uber.org/goleak"
)

// Regarding the godbus/dbus ignore: see https://github.com/99designs/keyring/issues/103
func TestMain(m *testing.M) {
goleak.VerifyTestMain(m, goleak.IgnoreAnyFunction("github.com/godbus/dbus.(*Conn).inWorker"))
}

0 comments on commit e837b08

Please sign in to comment.