diff --git a/pkg/stanza/operator/helper/ip_resolver_test.go b/pkg/stanza/operator/helper/ip_resolver_test.go index d660810817bb..7f4c82eec3d0 100644 --- a/pkg/stanza/operator/helper/ip_resolver_test.go +++ b/pkg/stanza/operator/helper/ip_resolver_test.go @@ -18,6 +18,7 @@ func TestIPResolverCacheLookup(t *testing.T) { } require.Equal(t, "definitely invalid hostname", resolver.GetHostFromIP("127.0.0.1")) + resolver.Stop() } func TestIPResolverCacheInvalidation(t *testing.T) { @@ -45,6 +46,7 @@ func TestIPResolver100Hits(t *testing.T) { for i := 0; i < 100; i++ { require.Equal(t, "definitely invalid hostname", resolver.GetHostFromIP("127.0.0.1")) } + resolver.Stop() } func TestIPResolverWithMultipleStops(_ *testing.T) { diff --git a/pkg/stanza/operator/helper/package_test.go b/pkg/stanza/operator/helper/package_test.go new file mode 100644 index 000000000000..c41dd2a22337 --- /dev/null +++ b/pkg/stanza/operator/helper/package_test.go @@ -0,0 +1,14 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package helper + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +}