Skip to content

Commit 78581d3

Browse files
crobert-1atoulmemx-psi
authored
[chore][extension/opampextension] Enable goleak check (#31175)
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This enables the `goleak` check for the opamp extension, to help ensure it's not leaking any goroutines. This is a test only change, a `Shutdown` call was missing. **Link to tracking Issue:** <Issue number if applicable> #30438 **Testing:** <Describe what testing was performed and which tests were added.> All existing tests are passing, as well as the added `goleak` check --------- Co-authored-by: Antoine Toulme <[email protected]> Co-authored-by: Pablo Baeyens <[email protected]>
1 parent 2bbd885 commit 78581d3

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

extension/opampextension/go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ require (
1616
go.opentelemetry.io/collector/semconv v0.95.0
1717
go.opentelemetry.io/otel/metric v1.23.1
1818
go.opentelemetry.io/otel/trace v1.23.1
19+
go.uber.org/goleak v1.3.0
1920
go.uber.org/zap v1.27.0
2021
gopkg.in/yaml.v3 v3.0.1
2122
)

extension/opampextension/opamp_agent_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,5 @@ func TestStart(t *testing.T) {
113113
assert.NoError(t, err)
114114

115115
assert.NoError(t, o.Start(context.TODO(), componenttest.NewNopHost()))
116+
assert.NoError(t, o.Shutdown(context.TODO()))
116117
}
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package opampextension
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}

0 commit comments

Comments
 (0)