From 0f9015d1015bb98bbda9ec77bfe15ce16c55707a Mon Sep 17 00:00:00 2001 From: Curtis Robert Date: Fri, 9 Feb 2024 15:34:14 -0800 Subject: [PATCH 1/2] [extension/opampextension] Enable goleak check --- extension/opampextension/go.mod | 1 + extension/opampextension/opamp_agent_test.go | 1 + extension/opampextension/package_test.go | 14 ++++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 extension/opampextension/package_test.go diff --git a/extension/opampextension/go.mod b/extension/opampextension/go.mod index ba191e29f5e2..f0533d2ce00d 100644 --- a/extension/opampextension/go.mod +++ b/extension/opampextension/go.mod @@ -16,6 +16,7 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 + go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/extension/opampextension/opamp_agent_test.go b/extension/opampextension/opamp_agent_test.go index 5332d7769f80..bc6c26735ac0 100644 --- a/extension/opampextension/opamp_agent_test.go +++ b/extension/opampextension/opamp_agent_test.go @@ -113,4 +113,5 @@ func TestStart(t *testing.T) { assert.NoError(t, err) assert.NoError(t, o.Start(context.TODO(), componenttest.NewNopHost())) + assert.NoError(t, o.Shutdown(context.TODO())) } diff --git a/extension/opampextension/package_test.go b/extension/opampextension/package_test.go new file mode 100644 index 000000000000..c15f00e62f80 --- /dev/null +++ b/extension/opampextension/package_test.go @@ -0,0 +1,14 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package opampextension + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} From c2ec11109062f898276a59ebe9e68d2f64f47170 Mon Sep 17 00:00:00 2001 From: Curtis Robert Date: Thu, 29 Feb 2024 10:33:07 -0800 Subject: [PATCH 2/2] make gotidy --- exporter/datadogexporter/integrationtest/go.sum | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exporter/datadogexporter/integrationtest/go.sum b/exporter/datadogexporter/integrationtest/go.sum index b4c6d6cdea99..f74498f21e96 100644 --- a/exporter/datadogexporter/integrationtest/go.sum +++ b/exporter/datadogexporter/integrationtest/go.sum @@ -326,8 +326,8 @@ github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd/go.mod h1:M5qHK+eWf github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= -github.com/haimrubinstein/go-syslog/v3 v3.0.0 h1:wuTrxJE60wx2pfwdERdbLNlcXEk3hk1MPagAaD2fq2g= -github.com/haimrubinstein/go-syslog/v3 v3.0.0/go.mod h1:/IKKpe5PS9pB5vJY1APQQM0ZPBrm95HWE1SQwsXWmVI= +github.com/haimrubinstein/go-syslog/v3 v3.0.3 h1:6vHBlaBT7QYW3Lg3SRH6ktd4RXDtysxtJ2sbbmnR984= +github.com/haimrubinstein/go-syslog/v3 v3.0.3/go.mod h1:eoxN4jiSgfvW5ZozHBsvBMVVOa8kUBnCghxP5PRL2Hs= github.com/hashicorp/consul/api v1.27.0 h1:gmJ6DPKQog1426xsdmgk5iqDyoRiNc+ipBdJOqKQFjc= github.com/hashicorp/consul/api v1.27.0/go.mod h1:JkekNRSou9lANFdt+4IKx3Za7XY0JzzpQjEb4Ivo1c8= github.com/hashicorp/cronexpr v1.1.2 h1:wG/ZYIKT+RT3QkOdgYc+xsKWVRgnxJ1OJtjjy84fJ9A=