Skip to content

Commit 61510e8

Browse files
crobert-1cparkins
authored andcommitted
[chore] Enable all (passing) goleak checks (open-telemetry#30451)
**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 PR contains 3 main changes: 1. Make a copy of the same file into every package whose `goleak` check is currently passing. The only change for the `package_test.go` file in each package is the package name itself. 2. Rename `processor/tailsamplingprocessor/main_test.go` to `package_test.go` for uniformity. `package_test.go` is the name we chose for core (see discussion [here](open-telemetry/opentelemetry-collector#9173 (comment))). 3. Run `make gotidy` to add `goleak` dependency. I included the script used to make these changes [in the issue](open-telemetry#30438 (comment)). **Link to tracking Issue:** <Issue number if applicable> open-telemetry#30438
1 parent 4beec16 commit 61510e8

File tree

340 files changed

+2989
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

340 files changed

+2989
-1
lines changed

cmd/opampsupervisor/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ require (
1313
github.com/stretchr/testify v1.8.4
1414
go.opentelemetry.io/collector/config/configtls v0.92.1-0.20240117180253-4371e14440ee
1515
go.opentelemetry.io/collector/semconv v0.92.1-0.20240117180253-4371e14440ee
16+
go.uber.org/goleak v1.3.0
1617
go.uber.org/zap v1.26.0
1718
)
1819

cmd/opampsupervisor/go.sum

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
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 supervisor
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}

cmd/telemetrygen/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ require (
1919
go.opentelemetry.io/otel/sdk v1.21.0
2020
go.opentelemetry.io/otel/sdk/metric v1.21.0
2121
go.opentelemetry.io/otel/trace v1.21.0
22+
go.uber.org/goleak v1.3.0
2223
go.uber.org/zap v1.26.0
2324
golang.org/x/time v0.5.0
2425
google.golang.org/grpc v1.60.1

cmd/telemetrygen/go.sum

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
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 common
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}
Lines changed: 14 additions & 0 deletions
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 logs
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}
Lines changed: 14 additions & 0 deletions
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 metrics
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}
Lines changed: 14 additions & 0 deletions
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 traces
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}

confmap/provider/s3provider/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.0
99
github.com/stretchr/testify v1.8.4
1010
go.opentelemetry.io/collector/confmap v0.92.1-0.20240117180253-4371e14440ee
11+
go.uber.org/goleak v1.3.0
1112
gopkg.in/yaml.v2 v2.4.0
1213
)
1314

0 commit comments

Comments
 (0)