diff --git a/processor/cumulativetodeltaprocessor/factory_test.go b/processor/cumulativetodeltaprocessor/factory_test.go index 1a5fc624d80d..109244f970d9 100644 --- a/processor/cumulativetodeltaprocessor/factory_test.go +++ b/processor/cumulativetodeltaprocessor/factory_test.go @@ -62,6 +62,7 @@ func TestCreateProcessors(t *testing.T) { consumertest.NewNop()) assert.NotNil(t, mp) assert.NoError(t, mErr) + assert.NoError(t, mp.Shutdown(context.Background())) }) } } diff --git a/processor/cumulativetodeltaprocessor/package_test.go b/processor/cumulativetodeltaprocessor/package_test.go new file mode 100644 index 000000000000..00a5411fe5cc --- /dev/null +++ b/processor/cumulativetodeltaprocessor/package_test.go @@ -0,0 +1,17 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package cumulativetodeltaprocessor + +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")) +}