From 663a04ede68eca213ae40f69fa6756e5cfbbaef9 Mon Sep 17 00:00:00 2001 From: Pushkar Mishra Date: Tue, 16 Jan 2024 12:41:35 +0530 Subject: [PATCH] Replace goleak.VerifyTestMain with testutils.VerifyGoLeaks (#5108) ## Which problem is this PR solving? - Part of #5006 ## Description of the changes - Fixed Script to count `testutils.VerifyGoLeaks` as satisfactory. - Replaced `goleak.VerifyTestMain` with `testutils.VerifyGoLeaks`. ## How was this change tested? - `make test` ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [ ] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Pushkar Mishra Co-authored-by: Yuri Shkuro --- .golangci.yml | 7 ++++++ .../app/configmanager/grpc/manager_test.go | 4 +-- cmd/agent/app/configmanager/metrics_test.go | 4 +-- .../buffered_read_transport_test.go | 5 ++-- cmd/agent/app/httpserver/srv_test.go | 5 ++-- cmd/agent/app/processors/package_test.go | 25 +++++++++++++++++++ .../app/processors/thrift_processor_test.go | 5 ---- cmd/agent/app/reporter/grpc/package_test.go | 4 +-- cmd/agent/app/reporter/package_test.go | 4 +-- cmd/agent/app/servers/server_test.go | 5 ++-- .../app/servers/thriftudp/transport_test.go | 5 ++-- cmd/agent/app/testutils/package_test.go | 4 +-- .../setupcontext/setupcontext_test.go | 5 ++-- cmd/anonymizer/app/flags_test.go | 5 ++-- cmd/anonymizer/app/uiconv/package_test.go | 4 +-- cmd/collector/app/flags/flags_test.go | 4 +-- cmd/collector/app/handler/package_test.go | 4 +-- cmd/collector/app/processor/empty_test.go | 4 +-- .../app/sampling/grpc_handler_test.go | 4 +-- .../app/sampling/model/empty_test.go | 4 +-- .../app/sampling/strategystore/empty_test.go | 4 +-- .../cache/auto_refresh_cache_test.go | 4 +-- cmd/collector/app/sanitizer/package_test.go | 4 +-- .../sanitizer/zipkin/span_sanitizer_test.go | 4 +-- cmd/collector/app/server/package_test.go | 4 +-- cmd/es-index-cleaner/app/package_test.go | 4 +-- cmd/es-rollover/app/init/package_test.go | 4 +-- cmd/es-rollover/app/lookback/package_test.go | 4 +-- cmd/es-rollover/app/package_test.go | 4 +-- cmd/es-rollover/app/rollover/package_test.go | 4 +-- cmd/esmapping-generator/app/flags_test.go | 5 ++-- .../app/renderer/render_test.go | 4 +-- cmd/ingester/app/builder/empty_test.go | 4 +-- .../app/consumer/offset/package_test.go | 4 +-- cmd/ingester/app/consumer/package_test.go | 4 +-- cmd/ingester/app/flags_test.go | 4 +-- .../app/processor/decorator/retry_test.go | 4 +-- cmd/ingester/app/processor/package_test.go | 4 +-- cmd/internal/docs/command_test.go | 5 ++-- cmd/internal/env/command_test.go | 3 +-- cmd/internal/status/command_test.go | 5 ++-- .../exporters/storageexporter/package_test.go | 4 +-- cmd/query/app/apiv3/package_test.go | 4 +-- cmd/query/app/querysvc/query_service_test.go | 4 +-- cmd/query/app/ui/empty_test.go | 4 +-- crossdock/services/pakcage_test.go | 4 +-- empty_test.go | 4 +-- examples/hotrod/cmd/empty_test.go | 4 +-- examples/hotrod/pkg/delay/empty_test.go | 4 +-- examples/hotrod/pkg/httperr/empty_test.go | 4 +-- examples/hotrod/pkg/log/empty_test.go | 4 +-- examples/hotrod/pkg/pool/empty_test.go | 4 +-- examples/hotrod/pkg/tracing/empty_test.go | 4 +-- .../pkg/tracing/rpcmetrics/package_test.go | 4 +-- examples/hotrod/services/config/empty_test.go | 4 +-- .../hotrod/services/customer/empty_test.go | 4 +-- examples/hotrod/services/driver/empty_test.go | 4 +-- .../hotrod/services/frontend/empty_test.go | 4 +-- examples/hotrod/services/route/empty_test.go | 4 +-- internal/grpctest/reflection_test.go | 5 ++-- internal/jaegerclientenv2otel/envvars_test.go | 3 +-- internal/metrics/expvar/package_test.go | 4 +-- internal/metrics/fork/fork_test.go | 5 ++-- .../metrics/metricsbuilder/builder_test.go | 4 +-- internal/metrics/prometheus/factory_test.go | 4 +-- internal/metricstest/package_test.go | 4 +-- model/adjuster/package_test.go | 4 +-- model/converter/empty_test.go | 4 +-- model/converter/json/package_test.go | 4 +-- model/converter/thrift/empty_test.go | 4 +-- model/converter/thrift/jaeger/package_test.go | 4 +-- model/converter/thrift/zipkin/package_test.go | 4 +-- model/json/empty_test.go | 4 +-- model/package_test.go | 4 +-- pkg/bearertoken/package_test.go | 4 +-- pkg/cache/lru_test.go | 5 ++-- pkg/cassandra/config/empty_test.go | 4 +-- pkg/cassandra/empty_test.go | 4 +-- pkg/cassandra/gocql/empty_test.go | 4 +-- pkg/cassandra/metrics/table_test.go | 3 +-- pkg/clientcfg/clientcfghttp/package_test.go | 4 +-- pkg/config/corscfg/flags_test.go | 4 +-- pkg/config/package_test.go | 4 +-- pkg/config/tlscfg/package_test.go | 4 +-- .../grpcresolver/grpc_resolver_test.go | 4 +-- pkg/discovery/package_test.go | 4 +-- pkg/distributedlock/empty_test.go | 4 +-- pkg/empty_test.go | 4 +-- pkg/es/client/package_test.go | 4 +-- pkg/es/empty_test.go | 4 +-- pkg/es/filter/package_test.go | 4 +-- pkg/es/wrapper/empty_test.go | 4 +-- pkg/fswatcher/fswatcher_test.go | 5 ++-- pkg/gzipfs/gzip_test.go | 5 ++-- pkg/healthcheck/package_test.go | 4 +-- pkg/hostname/hostname_test.go | 5 ++-- pkg/httpfs/prefixed_test.go | 5 ++-- pkg/httpmetrics/metrics_test.go | 4 +-- pkg/jtracer/jtracer_test.go | 5 ++-- pkg/kafka/auth/empty_test.go | 4 +-- pkg/kafka/consumer/empty_test.go | 4 +-- pkg/kafka/producer/empty_test.go | 4 +-- pkg/memory/config/empty_test.go | 4 +-- pkg/metrics/metrics_test.go | 4 +-- pkg/netutils/port_test.go | 5 ++-- pkg/normalizer/service_name_test.go | 5 ++-- pkg/prometheus/config/empty_test.go | 4 +-- pkg/queue/bounded_queue_test.go | 4 +-- pkg/recoveryhandler/zap_test.go | 3 +-- pkg/tenancy/package_test.go | 4 +-- plugin/empty_test.go | 4 +-- plugin/metrics/disabled/package_test.go | 4 +-- plugin/metrics/package_test.go | 4 +-- plugin/metrics/prometheus/factory_test.go | 3 +-- .../metricsstore/dbmodel/to_domain_test.go | 4 +-- .../distributedlock/cassandra/lock_test.go | 4 +-- .../calculationstrategy/package_test.go | 4 +-- .../leaderelection/leader_election_test.go | 3 +-- plugin/sampling/strategystore/package_test.go | 4 +-- .../strategystore/static/package_test.go | 4 +-- .../badger/dependencystore/package_test.go | 4 +-- plugin/storage/badger/package_test.go | 4 +-- .../badger/samplingstore/storage_test.go | 3 +-- .../storage/badger/spanstore/package_test.go | 4 +-- plugin/storage/blackhole/package_test.go | 4 +-- .../cassandra/dependencystore/package_test.go | 4 +-- plugin/storage/cassandra/package_test.go | 4 +-- .../cassandra/samplingstore/storage_test.go | 3 +-- .../spanstore/dbmodel/package_test.go | 4 +-- .../cassandra/spanstore/package_test.go | 4 +-- .../dependencystore/dbmodel/converter_test.go | 4 +-- .../es/dependencystore/storage_test.go | 3 +-- plugin/storage/es/mappings/mapping_test.go | 4 +-- plugin/storage/es/package_test.go | 4 +-- .../es/spanstore/dbmodel/package_test.go | 4 +-- plugin/storage/es/spanstore/package_test.go | 4 +-- plugin/storage/grpc/config/empty_test.go | 4 +-- plugin/storage/grpc/memory/plugin_test.go | 4 +-- plugin/storage/grpc/package_test.go | 4 +-- .../grpc/proto/storage_v1/storage_test.go | 4 +-- plugin/storage/grpc/shared/package_test.go | 4 +-- plugin/storage/kafka/package_test.go | 4 +-- plugin/storage/memory/package_test.go | 4 +-- plugin/storage/package_test.go | 4 +-- ports/ports_test.go | 5 ++-- scripts/check-goleak-files.sh | 2 +- storage/dependencystore/empty_test.go | 4 +-- storage/empty_test.go | 4 +-- storage/metricsstore/empty_test.go | 4 +-- .../metricsstore/metrics/decorator_test.go | 4 +-- storage/samplingstore/empty_test.go | 4 +-- storage/spanstore/interface_test.go | 4 +-- storage/spanstore/metrics/package_test.go | 4 +-- 153 files changed, 334 insertions(+), 312 deletions(-) create mode 100644 cmd/agent/app/processors/package_test.go diff --git a/.golangci.yml b/.golangci.yml index 94ccbe71f62..4aaf36ca19d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -112,6 +112,13 @@ linters-settings: desc: "Do not refer to crossdock from other packages" files: - "!**/crossdock/**" + + disallow-uber/goleak: + deny: + - pkg: go.uber.org/goleak + desc: "Use github.com/jaegertracing/jaeger/pkg/testutils" + files: + - "**_test.go" goimports: local-prefixes: github.com/jaegertracing/jaeger diff --git a/cmd/agent/app/configmanager/grpc/manager_test.go b/cmd/agent/app/configmanager/grpc/manager_test.go index d975eead7dc..e1eee2ded8f 100644 --- a/cmd/agent/app/configmanager/grpc/manager_test.go +++ b/cmd/agent/app/configmanager/grpc/manager_test.go @@ -22,10 +22,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" + "github.com/jaegertracing/jaeger/pkg/testutils" "github.com/jaegertracing/jaeger/proto-gen/api_v2" ) @@ -84,5 +84,5 @@ func initializeGRPCTestServer(t *testing.T, beforeServe func(server *grpc.Server } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/agent/app/configmanager/metrics_test.go b/cmd/agent/app/configmanager/metrics_test.go index 36239e417d9..7eb0755cec0 100644 --- a/cmd/agent/app/configmanager/metrics_test.go +++ b/cmd/agent/app/configmanager/metrics_test.go @@ -21,9 +21,9 @@ import ( "time" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/internal/metricstest" + "github.com/jaegertracing/jaeger/pkg/testutils" "github.com/jaegertracing/jaeger/proto-gen/api_v2" "github.com/jaegertracing/jaeger/thrift-gen/baggage" ) @@ -90,5 +90,5 @@ func TestMetrics(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/agent/app/customtransport/buffered_read_transport_test.go b/cmd/agent/app/customtransport/buffered_read_transport_test.go index 06cbf46fbff..c9bf0c5a4f3 100644 --- a/cmd/agent/app/customtransport/buffered_read_transport_test.go +++ b/cmd/agent/app/customtransport/buffered_read_transport_test.go @@ -21,7 +21,8 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) // TestTBufferedReadTransport tests the TBufferedReadTransport @@ -72,5 +73,5 @@ func TestTBufferedReadTransportEmptyFunctions(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/agent/app/httpserver/srv_test.go b/cmd/agent/app/httpserver/srv_test.go index 5485fef5312..0a11d56b98e 100644 --- a/cmd/agent/app/httpserver/srv_test.go +++ b/cmd/agent/app/httpserver/srv_test.go @@ -19,8 +19,9 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.uber.org/goleak" "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestHTTPServer(t *testing.T) { @@ -29,5 +30,5 @@ func TestHTTPServer(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/agent/app/processors/package_test.go b/cmd/agent/app/processors/package_test.go new file mode 100644 index 00000000000..5b252bdefec --- /dev/null +++ b/cmd/agent/app/processors/package_test.go @@ -0,0 +1,25 @@ +// Copyright (c) 2024 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package processors + +import ( + "testing" + + "github.com/jaegertracing/jaeger/pkg/testutils" +) + +func TestMain(m *testing.M) { + testutils.VerifyGoLeaks(m) +} diff --git a/cmd/agent/app/processors/thrift_processor_test.go b/cmd/agent/app/processors/thrift_processor_test.go index 7c81e9811bd..97ea396fdac 100644 --- a/cmd/agent/app/processors/thrift_processor_test.go +++ b/cmd/agent/app/processors/thrift_processor_test.go @@ -24,7 +24,6 @@ import ( "github.com/apache/thrift/lib/go/thrift" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "go.uber.org/zap/zaptest" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -244,7 +243,3 @@ func assertCollectorReceivedData( {Name: "thrift.udp.server.packets.processed", Value: 1}, }...) } - -func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) -} diff --git a/cmd/agent/app/reporter/grpc/package_test.go b/cmd/agent/app/reporter/grpc/package_test.go index 5c91dca838a..08ff9253b03 100644 --- a/cmd/agent/app/reporter/grpc/package_test.go +++ b/cmd/agent/app/reporter/grpc/package_test.go @@ -17,9 +17,9 @@ package grpc import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/agent/app/reporter/package_test.go b/cmd/agent/app/reporter/package_test.go index e0c68918bf5..0a1ddfa6e22 100644 --- a/cmd/agent/app/reporter/package_test.go +++ b/cmd/agent/app/reporter/package_test.go @@ -17,9 +17,9 @@ package reporter import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/agent/app/servers/server_test.go b/cmd/agent/app/servers/server_test.go index d1934b10060..551bb6999bb 100644 --- a/cmd/agent/app/servers/server_test.go +++ b/cmd/agent/app/servers/server_test.go @@ -21,7 +21,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestReadBuf_EOF(t *testing.T) { @@ -41,5 +42,5 @@ func TestReadBuf_Read(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/agent/app/servers/thriftudp/transport_test.go b/cmd/agent/app/servers/thriftudp/transport_test.go index b1830f64af9..ccacdcd42fe 100644 --- a/cmd/agent/app/servers/thriftudp/transport_test.go +++ b/cmd/agent/app/servers/thriftudp/transport_test.go @@ -25,7 +25,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) var localListenAddr = &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1)} @@ -242,5 +243,5 @@ func TestCreateClient(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/agent/app/testutils/package_test.go b/cmd/agent/app/testutils/package_test.go index 21172462e87..952a0398b41 100644 --- a/cmd/agent/app/testutils/package_test.go +++ b/cmd/agent/app/testutils/package_test.go @@ -17,9 +17,9 @@ package testutils import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/all-in-one/setupcontext/setupcontext_test.go b/cmd/all-in-one/setupcontext/setupcontext_test.go index 270cb5ec9b6..b747db35a9e 100644 --- a/cmd/all-in-one/setupcontext/setupcontext_test.go +++ b/cmd/all-in-one/setupcontext/setupcontext_test.go @@ -18,7 +18,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestSetupContext(t *testing.T) { @@ -29,5 +30,5 @@ func TestSetupContext(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/anonymizer/app/flags_test.go b/cmd/anonymizer/app/flags_test.go index 215b4b6f855..ad01163d81c 100644 --- a/cmd/anonymizer/app/flags_test.go +++ b/cmd/anonymizer/app/flags_test.go @@ -19,7 +19,8 @@ import ( "github.com/spf13/cobra" "github.com/stretchr/testify/assert" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestOptionsWithDefaultFlags(t *testing.T) { @@ -63,5 +64,5 @@ func TestOptionsWithFlags(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/anonymizer/app/uiconv/package_test.go b/cmd/anonymizer/app/uiconv/package_test.go index 61f60ecc06c..fc543a96af3 100644 --- a/cmd/anonymizer/app/uiconv/package_test.go +++ b/cmd/anonymizer/app/uiconv/package_test.go @@ -17,9 +17,9 @@ package uiconv import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/collector/app/flags/flags_test.go b/cmd/collector/app/flags/flags_test.go index e158fa74f8f..d2fddd69779 100644 --- a/cmd/collector/app/flags/flags_test.go +++ b/cmd/collector/app/flags/flags_test.go @@ -20,10 +20,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "go.uber.org/zap" "github.com/jaegertracing/jaeger/pkg/config" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestCollectorOptionsWithFlags_CheckHostPort(t *testing.T) { @@ -191,5 +191,5 @@ func TestCollectorOptionsWithFlags_CheckZipkinKeepAlive(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/collector/app/handler/package_test.go b/cmd/collector/app/handler/package_test.go index 7fbc1f255a3..50430a2a98d 100644 --- a/cmd/collector/app/handler/package_test.go +++ b/cmd/collector/app/handler/package_test.go @@ -16,11 +16,9 @@ package handler import ( "testing" - "go.uber.org/goleak" - "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m, testutils.IgnoreOpenCensusWorkerLeak()) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/collector/app/processor/empty_test.go b/cmd/collector/app/processor/empty_test.go index 7d6dcbe2a28..24da859eaed 100644 --- a/cmd/collector/app/processor/empty_test.go +++ b/cmd/collector/app/processor/empty_test.go @@ -17,9 +17,9 @@ package processor import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/collector/app/sampling/grpc_handler_test.go b/cmd/collector/app/sampling/grpc_handler_test.go index f353498a335..3a6590bf1ad 100644 --- a/cmd/collector/app/sampling/grpc_handler_test.go +++ b/cmd/collector/app/sampling/grpc_handler_test.go @@ -20,9 +20,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "golang.org/x/net/context" + "github.com/jaegertracing/jaeger/pkg/testutils" "github.com/jaegertracing/jaeger/proto-gen/api_v2" ) @@ -61,5 +61,5 @@ func TestNewGRPCHandler(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/collector/app/sampling/model/empty_test.go b/cmd/collector/app/sampling/model/empty_test.go index c7fedda32c6..f6925ab4b88 100644 --- a/cmd/collector/app/sampling/model/empty_test.go +++ b/cmd/collector/app/sampling/model/empty_test.go @@ -17,9 +17,9 @@ package model import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/collector/app/sampling/strategystore/empty_test.go b/cmd/collector/app/sampling/strategystore/empty_test.go index d39578922f8..268682b4400 100644 --- a/cmd/collector/app/sampling/strategystore/empty_test.go +++ b/cmd/collector/app/sampling/strategystore/empty_test.go @@ -17,9 +17,9 @@ package strategystore import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/collector/app/sanitizer/cache/auto_refresh_cache_test.go b/cmd/collector/app/sanitizer/cache/auto_refresh_cache_test.go index 19c0b7f8082..8295fe9ec48 100644 --- a/cmd/collector/app/sanitizer/cache/auto_refresh_cache_test.go +++ b/cmd/collector/app/sanitizer/cache/auto_refresh_cache_test.go @@ -22,10 +22,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "go.uber.org/zap" "github.com/jaegertracing/jaeger/cmd/collector/app/sanitizer/cache/mocks" + "github.com/jaegertracing/jaeger/pkg/testutils" ) var ( @@ -231,5 +231,5 @@ func TestIsEmpty(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/collector/app/sanitizer/package_test.go b/cmd/collector/app/sanitizer/package_test.go index 60eb3d22132..3d7535a5d3d 100644 --- a/cmd/collector/app/sanitizer/package_test.go +++ b/cmd/collector/app/sanitizer/package_test.go @@ -17,9 +17,9 @@ package sanitizer import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/collector/app/sanitizer/zipkin/span_sanitizer_test.go b/cmd/collector/app/sanitizer/zipkin/span_sanitizer_test.go index b591b207f1c..c9584ab9a9b 100644 --- a/cmd/collector/app/sanitizer/zipkin/span_sanitizer_test.go +++ b/cmd/collector/app/sanitizer/zipkin/span_sanitizer_test.go @@ -19,8 +19,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" "github.com/jaegertracing/jaeger/thrift-gen/zipkincore" ) @@ -203,5 +203,5 @@ func TestSpanStartTimeSanitizer(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/collector/app/server/package_test.go b/cmd/collector/app/server/package_test.go index caadfc29f87..2cf94b646ba 100644 --- a/cmd/collector/app/server/package_test.go +++ b/cmd/collector/app/server/package_test.go @@ -17,11 +17,9 @@ package server import ( "testing" - "go.uber.org/goleak" - "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m, testutils.IgnoreOpenCensusWorkerLeak()) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/es-index-cleaner/app/package_test.go b/cmd/es-index-cleaner/app/package_test.go index 742c64d352a..113e0e77023 100644 --- a/cmd/es-index-cleaner/app/package_test.go +++ b/cmd/es-index-cleaner/app/package_test.go @@ -17,9 +17,9 @@ package app import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/es-rollover/app/init/package_test.go b/cmd/es-rollover/app/init/package_test.go index 3630823758f..340f948e45d 100644 --- a/cmd/es-rollover/app/init/package_test.go +++ b/cmd/es-rollover/app/init/package_test.go @@ -17,9 +17,9 @@ package init import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/es-rollover/app/lookback/package_test.go b/cmd/es-rollover/app/lookback/package_test.go index 60c7d7f6c58..0ddbf0291df 100644 --- a/cmd/es-rollover/app/lookback/package_test.go +++ b/cmd/es-rollover/app/lookback/package_test.go @@ -17,9 +17,9 @@ package lookback import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/es-rollover/app/package_test.go b/cmd/es-rollover/app/package_test.go index 742c64d352a..113e0e77023 100644 --- a/cmd/es-rollover/app/package_test.go +++ b/cmd/es-rollover/app/package_test.go @@ -17,9 +17,9 @@ package app import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/es-rollover/app/rollover/package_test.go b/cmd/es-rollover/app/rollover/package_test.go index 7550f685e47..545224a6173 100644 --- a/cmd/es-rollover/app/rollover/package_test.go +++ b/cmd/es-rollover/app/rollover/package_test.go @@ -17,9 +17,9 @@ package rollover import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/esmapping-generator/app/flags_test.go b/cmd/esmapping-generator/app/flags_test.go index f4976b3e589..b91ac7b09f9 100644 --- a/cmd/esmapping-generator/app/flags_test.go +++ b/cmd/esmapping-generator/app/flags_test.go @@ -20,7 +20,8 @@ import ( "github.com/spf13/cobra" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestOptionsWithDefaultFlags(t *testing.T) { @@ -62,5 +63,5 @@ func TestOptionsWithFlags(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/esmapping-generator/app/renderer/render_test.go b/cmd/esmapping-generator/app/renderer/render_test.go index 852ff331c51..b971d800d87 100644 --- a/cmd/esmapping-generator/app/renderer/render_test.go +++ b/cmd/esmapping-generator/app/renderer/render_test.go @@ -22,10 +22,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/cmd/esmapping-generator/app" "github.com/jaegertracing/jaeger/pkg/es/mocks" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestIsValidOption(t *testing.T) { @@ -101,5 +101,5 @@ func Test_getMappingAsString(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/ingester/app/builder/empty_test.go b/cmd/ingester/app/builder/empty_test.go index 0498415cd31..071906f13bc 100644 --- a/cmd/ingester/app/builder/empty_test.go +++ b/cmd/ingester/app/builder/empty_test.go @@ -17,9 +17,9 @@ package builder import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/ingester/app/consumer/offset/package_test.go b/cmd/ingester/app/consumer/offset/package_test.go index 34432378cf0..f165df96789 100644 --- a/cmd/ingester/app/consumer/offset/package_test.go +++ b/cmd/ingester/app/consumer/offset/package_test.go @@ -17,9 +17,9 @@ package offset import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/ingester/app/consumer/package_test.go b/cmd/ingester/app/consumer/package_test.go index 287cb02e5b4..55136a0cff5 100644 --- a/cmd/ingester/app/consumer/package_test.go +++ b/cmd/ingester/app/consumer/package_test.go @@ -17,9 +17,9 @@ package consumer import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/ingester/app/flags_test.go b/cmd/ingester/app/flags_test.go index ad5fed244b4..456a82fa165 100644 --- a/cmd/ingester/app/flags_test.go +++ b/cmd/ingester/app/flags_test.go @@ -21,11 +21,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/pkg/config" "github.com/jaegertracing/jaeger/pkg/config/tlscfg" "github.com/jaegertracing/jaeger/pkg/kafka/auth" + "github.com/jaegertracing/jaeger/pkg/testutils" "github.com/jaegertracing/jaeger/plugin/storage/kafka" ) @@ -113,5 +113,5 @@ func TestFlagDefaults(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/ingester/app/processor/decorator/retry_test.go b/cmd/ingester/app/processor/decorator/retry_test.go index f97169a5549..c48e923d51d 100644 --- a/cmd/ingester/app/processor/decorator/retry_test.go +++ b/cmd/ingester/app/processor/decorator/retry_test.go @@ -21,11 +21,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/cmd/ingester/app/processor/mocks" "github.com/jaegertracing/jaeger/internal/metricstest" "github.com/jaegertracing/jaeger/pkg/metrics" + "github.com/jaegertracing/jaeger/pkg/testutils" ) type fakeMsg struct{} @@ -149,5 +149,5 @@ func Test_ProcessBackoff(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/ingester/app/processor/package_test.go b/cmd/ingester/app/processor/package_test.go index f86ce3eaecd..b0129d6f5de 100644 --- a/cmd/ingester/app/processor/package_test.go +++ b/cmd/ingester/app/processor/package_test.go @@ -17,9 +17,9 @@ package processor import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/internal/docs/command_test.go b/cmd/internal/docs/command_test.go index ae384e5ca33..d25dbd8e532 100644 --- a/cmd/internal/docs/command_test.go +++ b/cmd/internal/docs/command_test.go @@ -23,7 +23,8 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestOutputFormats(t *testing.T) { @@ -69,5 +70,5 @@ func TestDocsForParent(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/internal/env/command_test.go b/cmd/internal/env/command_test.go index 4169b70eeae..919261f536f 100644 --- a/cmd/internal/env/command_test.go +++ b/cmd/internal/env/command_test.go @@ -20,7 +20,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/pkg/testutils" ) @@ -35,5 +34,5 @@ func TestCommand(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m, testutils.IgnoreGlogFlushDaemonLeak()) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/internal/status/command_test.go b/cmd/internal/status/command_test.go index 79a5455adc6..16dcad59080 100644 --- a/cmd/internal/status/command_test.go +++ b/cmd/internal/status/command_test.go @@ -22,7 +22,8 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/require" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func readyHandler(w http.ResponseWriter, r *http.Request) { @@ -73,5 +74,5 @@ func TestNoService(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/jaeger/internal/exporters/storageexporter/package_test.go b/cmd/jaeger/internal/exporters/storageexporter/package_test.go index b12fbdfeec4..1e8ad115526 100644 --- a/cmd/jaeger/internal/exporters/storageexporter/package_test.go +++ b/cmd/jaeger/internal/exporters/storageexporter/package_test.go @@ -17,11 +17,9 @@ package storageexporter import ( "testing" - "go.uber.org/goleak" - "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m, testutils.IgnoreOpenCensusWorkerLeak()) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/query/app/apiv3/package_test.go b/cmd/query/app/apiv3/package_test.go index c56173a61a1..61072ed8373 100644 --- a/cmd/query/app/apiv3/package_test.go +++ b/cmd/query/app/apiv3/package_test.go @@ -6,9 +6,9 @@ package apiv3 import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/query/app/querysvc/query_service_test.go b/cmd/query/app/querysvc/query_service_test.go index e646b8bace1..41231993930 100644 --- a/cmd/query/app/querysvc/query_service_test.go +++ b/cmd/query/app/querysvc/query_service_test.go @@ -23,12 +23,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "go.uber.org/zap" "github.com/jaegertracing/jaeger/model" "github.com/jaegertracing/jaeger/model/adjuster" "github.com/jaegertracing/jaeger/pkg/metrics" + "github.com/jaegertracing/jaeger/pkg/testutils" "github.com/jaegertracing/jaeger/storage" "github.com/jaegertracing/jaeger/storage/dependencystore" depsmocks "github.com/jaegertracing/jaeger/storage/dependencystore/mocks" @@ -367,5 +367,5 @@ func TestInitArchiveStorage(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/cmd/query/app/ui/empty_test.go b/cmd/query/app/ui/empty_test.go index a5940340cd9..afa486ada62 100644 --- a/cmd/query/app/ui/empty_test.go +++ b/cmd/query/app/ui/empty_test.go @@ -17,9 +17,9 @@ package ui import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/crossdock/services/pakcage_test.go b/crossdock/services/pakcage_test.go index 2b81c8b0edc..e8d7da23c39 100644 --- a/crossdock/services/pakcage_test.go +++ b/crossdock/services/pakcage_test.go @@ -17,9 +17,9 @@ package services import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/empty_test.go b/empty_test.go index 9cdf96af026..f47c1cd1584 100644 --- a/empty_test.go +++ b/empty_test.go @@ -17,7 +17,7 @@ package jaeger import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestDummy(t *testing.T) { @@ -26,5 +26,5 @@ func TestDummy(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/examples/hotrod/cmd/empty_test.go b/examples/hotrod/cmd/empty_test.go index e81a798d0c3..febd67c3454 100644 --- a/examples/hotrod/cmd/empty_test.go +++ b/examples/hotrod/cmd/empty_test.go @@ -17,9 +17,9 @@ package cmd import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/examples/hotrod/pkg/delay/empty_test.go b/examples/hotrod/pkg/delay/empty_test.go index 75c6d1e8a8d..54f880a9979 100644 --- a/examples/hotrod/pkg/delay/empty_test.go +++ b/examples/hotrod/pkg/delay/empty_test.go @@ -17,9 +17,9 @@ package delay import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/examples/hotrod/pkg/httperr/empty_test.go b/examples/hotrod/pkg/httperr/empty_test.go index 73a7986c991..df44d981a95 100644 --- a/examples/hotrod/pkg/httperr/empty_test.go +++ b/examples/hotrod/pkg/httperr/empty_test.go @@ -17,9 +17,9 @@ package httperr import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/examples/hotrod/pkg/log/empty_test.go b/examples/hotrod/pkg/log/empty_test.go index 313bc0b5a92..2382c53f76d 100644 --- a/examples/hotrod/pkg/log/empty_test.go +++ b/examples/hotrod/pkg/log/empty_test.go @@ -17,9 +17,9 @@ package log import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/examples/hotrod/pkg/pool/empty_test.go b/examples/hotrod/pkg/pool/empty_test.go index fc9263f8115..235a4a19503 100644 --- a/examples/hotrod/pkg/pool/empty_test.go +++ b/examples/hotrod/pkg/pool/empty_test.go @@ -17,9 +17,9 @@ package pool import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/examples/hotrod/pkg/tracing/empty_test.go b/examples/hotrod/pkg/tracing/empty_test.go index 8f76b53ef73..04d608cd698 100644 --- a/examples/hotrod/pkg/tracing/empty_test.go +++ b/examples/hotrod/pkg/tracing/empty_test.go @@ -17,9 +17,9 @@ package tracing import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/examples/hotrod/pkg/tracing/rpcmetrics/package_test.go b/examples/hotrod/pkg/tracing/rpcmetrics/package_test.go index a4aa6c0b63e..81f8e8e27bc 100644 --- a/examples/hotrod/pkg/tracing/rpcmetrics/package_test.go +++ b/examples/hotrod/pkg/tracing/rpcmetrics/package_test.go @@ -17,9 +17,9 @@ package rpcmetrics import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/examples/hotrod/services/config/empty_test.go b/examples/hotrod/services/config/empty_test.go index 7b868ab9b52..943a57225b2 100644 --- a/examples/hotrod/services/config/empty_test.go +++ b/examples/hotrod/services/config/empty_test.go @@ -17,9 +17,9 @@ package config import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/examples/hotrod/services/customer/empty_test.go b/examples/hotrod/services/customer/empty_test.go index 5df12a80314..d9c068bf626 100644 --- a/examples/hotrod/services/customer/empty_test.go +++ b/examples/hotrod/services/customer/empty_test.go @@ -17,9 +17,9 @@ package customer import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/examples/hotrod/services/driver/empty_test.go b/examples/hotrod/services/driver/empty_test.go index cf898e03edb..f1723a06fdf 100644 --- a/examples/hotrod/services/driver/empty_test.go +++ b/examples/hotrod/services/driver/empty_test.go @@ -17,9 +17,9 @@ package driver import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/examples/hotrod/services/frontend/empty_test.go b/examples/hotrod/services/frontend/empty_test.go index 30dd9391ab3..81450b77c79 100644 --- a/examples/hotrod/services/frontend/empty_test.go +++ b/examples/hotrod/services/frontend/empty_test.go @@ -17,9 +17,9 @@ package frontend import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/examples/hotrod/services/route/empty_test.go b/examples/hotrod/services/route/empty_test.go index bc61c746ce9..ae5353890ee 100644 --- a/examples/hotrod/services/route/empty_test.go +++ b/examples/hotrod/services/route/empty_test.go @@ -17,9 +17,9 @@ package route import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/internal/grpctest/reflection_test.go b/internal/grpctest/reflection_test.go index b2b5b7575c7..a814e5418e7 100644 --- a/internal/grpctest/reflection_test.go +++ b/internal/grpctest/reflection_test.go @@ -19,9 +19,10 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "google.golang.org/grpc" "google.golang.org/grpc/reflection" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestReflectionServiceValidator(t *testing.T) { @@ -46,5 +47,5 @@ func TestReflectionServiceValidator(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/internal/jaegerclientenv2otel/envvars_test.go b/internal/jaegerclientenv2otel/envvars_test.go index 3c3eeda1434..80ad2afa600 100644 --- a/internal/jaegerclientenv2otel/envvars_test.go +++ b/internal/jaegerclientenv2otel/envvars_test.go @@ -19,7 +19,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/pkg/testutils" ) @@ -38,5 +37,5 @@ func TestMapJaegerToOtelEnvVars(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/internal/metrics/expvar/package_test.go b/internal/metrics/expvar/package_test.go index 608527e146e..dabfdda4fce 100644 --- a/internal/metrics/expvar/package_test.go +++ b/internal/metrics/expvar/package_test.go @@ -17,9 +17,9 @@ package expvar import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/internal/metrics/fork/fork_test.go b/internal/metrics/fork/fork_test.go index f2fcf9db8cb..f8232fbc829 100644 --- a/internal/metrics/fork/fork_test.go +++ b/internal/metrics/fork/fork_test.go @@ -18,10 +18,9 @@ import ( "testing" "time" - "go.uber.org/goleak" - "github.com/jaegertracing/jaeger/internal/metricstest" "github.com/jaegertracing/jaeger/pkg/metrics" + "github.com/jaegertracing/jaeger/pkg/testutils" ) var _ metrics.Factory = (*Factory)(nil) @@ -105,5 +104,5 @@ func TestForkFactory(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/internal/metrics/metricsbuilder/builder_test.go b/internal/metrics/metricsbuilder/builder_test.go index 62cb25518d0..565bfadb4dd 100644 --- a/internal/metrics/metricsbuilder/builder_test.go +++ b/internal/metrics/metricsbuilder/builder_test.go @@ -25,9 +25,9 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/pkg/metrics" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestAddFlags(t *testing.T) { @@ -127,5 +127,5 @@ func TestBuilder(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/internal/metrics/prometheus/factory_test.go b/internal/metrics/prometheus/factory_test.go index a21eed3d8b2..de5aaf2b91f 100644 --- a/internal/metrics/prometheus/factory_test.go +++ b/internal/metrics/prometheus/factory_test.go @@ -22,10 +22,10 @@ import ( promModel "github.com/prometheus/client_model/go" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" . "github.com/jaegertracing/jaeger/internal/metrics/prometheus" "github.com/jaegertracing/jaeger/pkg/metrics" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestOptions(t *testing.T) { @@ -438,5 +438,5 @@ func findMetric(t *testing.T, snapshot []*promModel.MetricFamily, name string, t } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/internal/metricstest/package_test.go b/internal/metricstest/package_test.go index bd8eb0d1aef..4359c60f8ee 100644 --- a/internal/metricstest/package_test.go +++ b/internal/metricstest/package_test.go @@ -17,9 +17,9 @@ package metricstest import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/model/adjuster/package_test.go b/model/adjuster/package_test.go index da1507a8c11..d2833ab5247 100644 --- a/model/adjuster/package_test.go +++ b/model/adjuster/package_test.go @@ -17,9 +17,9 @@ package adjuster import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/model/converter/empty_test.go b/model/converter/empty_test.go index 2bdc03ea5d5..ea6db368330 100644 --- a/model/converter/empty_test.go +++ b/model/converter/empty_test.go @@ -17,7 +17,7 @@ package converter import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestDummy(t *testing.T) { @@ -26,5 +26,5 @@ func TestDummy(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/model/converter/json/package_test.go b/model/converter/json/package_test.go index 0d912d36b34..7c4d72e6da0 100644 --- a/model/converter/json/package_test.go +++ b/model/converter/json/package_test.go @@ -17,9 +17,9 @@ package json import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/model/converter/thrift/empty_test.go b/model/converter/thrift/empty_test.go index ae70adeb4cb..a78e79544e4 100644 --- a/model/converter/thrift/empty_test.go +++ b/model/converter/thrift/empty_test.go @@ -17,7 +17,7 @@ package thrift import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestDummy(t *testing.T) { @@ -26,5 +26,5 @@ func TestDummy(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/model/converter/thrift/jaeger/package_test.go b/model/converter/thrift/jaeger/package_test.go index 2da64dbb777..74e82e95a61 100644 --- a/model/converter/thrift/jaeger/package_test.go +++ b/model/converter/thrift/jaeger/package_test.go @@ -17,9 +17,9 @@ package jaeger import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/model/converter/thrift/zipkin/package_test.go b/model/converter/thrift/zipkin/package_test.go index 23b0380c255..fa157921535 100644 --- a/model/converter/thrift/zipkin/package_test.go +++ b/model/converter/thrift/zipkin/package_test.go @@ -17,9 +17,9 @@ package zipkin import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/model/json/empty_test.go b/model/json/empty_test.go index 7808f78783f..04ca9149c99 100644 --- a/model/json/empty_test.go +++ b/model/json/empty_test.go @@ -17,9 +17,9 @@ package json import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/model/package_test.go b/model/package_test.go index 80b77768c79..f0075723465 100644 --- a/model/package_test.go +++ b/model/package_test.go @@ -17,9 +17,9 @@ package model import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/bearertoken/package_test.go b/pkg/bearertoken/package_test.go index f99a55d30a4..85f3a8788da 100644 --- a/pkg/bearertoken/package_test.go +++ b/pkg/bearertoken/package_test.go @@ -17,9 +17,9 @@ package bearertoken import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/cache/lru_test.go b/pkg/cache/lru_test.go index 7e9d7af5208..52eeed09413 100644 --- a/pkg/cache/lru_test.go +++ b/pkg/cache/lru_test.go @@ -21,7 +21,8 @@ import ( "time" "github.com/stretchr/testify/assert" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestLRU(t *testing.T) { @@ -243,5 +244,5 @@ func (c *simulatedClock) Elapse(d time.Duration) time.Time { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/cassandra/config/empty_test.go b/pkg/cassandra/config/empty_test.go index f2f65cd0f1d..d215d0e7fa4 100644 --- a/pkg/cassandra/config/empty_test.go +++ b/pkg/cassandra/config/empty_test.go @@ -17,9 +17,9 @@ package config import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/cassandra/empty_test.go b/pkg/cassandra/empty_test.go index e7757976a81..79ffdb8e1ce 100644 --- a/pkg/cassandra/empty_test.go +++ b/pkg/cassandra/empty_test.go @@ -17,9 +17,9 @@ package cassandra import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/cassandra/gocql/empty_test.go b/pkg/cassandra/gocql/empty_test.go index e2de4bfff26..d72e6cdab78 100644 --- a/pkg/cassandra/gocql/empty_test.go +++ b/pkg/cassandra/gocql/empty_test.go @@ -17,9 +17,9 @@ package gocql import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/cassandra/metrics/table_test.go b/pkg/cassandra/metrics/table_test.go index 31977a47c22..e4daf427995 100644 --- a/pkg/cassandra/metrics/table_test.go +++ b/pkg/cassandra/metrics/table_test.go @@ -22,7 +22,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/internal/metricstest" "github.com/jaegertracing/jaeger/pkg/testutils" @@ -161,5 +160,5 @@ func (q insertQuery) ScanCAS(dest ...interface{}) (bool, error) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/clientcfg/clientcfghttp/package_test.go b/pkg/clientcfg/clientcfghttp/package_test.go index 5f1b9d28a82..bee283c92ef 100644 --- a/pkg/clientcfg/clientcfghttp/package_test.go +++ b/pkg/clientcfg/clientcfghttp/package_test.go @@ -17,9 +17,9 @@ package clientcfghttp import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/config/corscfg/flags_test.go b/pkg/config/corscfg/flags_test.go index 3bf7a2b6f05..e772fbe3343 100644 --- a/pkg/config/corscfg/flags_test.go +++ b/pkg/config/corscfg/flags_test.go @@ -20,9 +20,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/pkg/config" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestCORSFlags(t *testing.T) { @@ -50,5 +50,5 @@ func TestCORSFlags(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/config/package_test.go b/pkg/config/package_test.go index f2f65cd0f1d..d215d0e7fa4 100644 --- a/pkg/config/package_test.go +++ b/pkg/config/package_test.go @@ -17,9 +17,9 @@ package config import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/config/tlscfg/package_test.go b/pkg/config/tlscfg/package_test.go index bf7b4f92a79..beca9e7d146 100644 --- a/pkg/config/tlscfg/package_test.go +++ b/pkg/config/tlscfg/package_test.go @@ -17,9 +17,9 @@ package tlscfg import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/discovery/grpcresolver/grpc_resolver_test.go b/pkg/discovery/grpcresolver/grpc_resolver_test.go index 21fb6b66c26..c0c64aa3de3 100644 --- a/pkg/discovery/grpcresolver/grpc_resolver_test.go +++ b/pkg/discovery/grpcresolver/grpc_resolver_test.go @@ -24,7 +24,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -33,6 +32,7 @@ import ( "google.golang.org/grpc/resolver" "github.com/jaegertracing/jaeger/pkg/discovery" + "github.com/jaegertracing/jaeger/pkg/testutils" ) type testServer struct { @@ -178,5 +178,5 @@ func TestRendezvousHash(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/discovery/package_test.go b/pkg/discovery/package_test.go index fb5a84d11e8..668369c1817 100644 --- a/pkg/discovery/package_test.go +++ b/pkg/discovery/package_test.go @@ -17,9 +17,9 @@ package discovery import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/distributedlock/empty_test.go b/pkg/distributedlock/empty_test.go index b9cacc5a43f..9d98d41a63f 100644 --- a/pkg/distributedlock/empty_test.go +++ b/pkg/distributedlock/empty_test.go @@ -17,9 +17,9 @@ package distributedlock import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/empty_test.go b/pkg/empty_test.go index df54281289b..ae11c0ea819 100644 --- a/pkg/empty_test.go +++ b/pkg/empty_test.go @@ -17,7 +17,7 @@ package pkg import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestDummy(t *testing.T) { @@ -26,5 +26,5 @@ func TestDummy(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/es/client/package_test.go b/pkg/es/client/package_test.go index 4181943eb3d..b9c6d9c2f95 100644 --- a/pkg/es/client/package_test.go +++ b/pkg/es/client/package_test.go @@ -17,9 +17,9 @@ package client import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/es/empty_test.go b/pkg/es/empty_test.go index 319b337b7c7..3312ddd71ab 100644 --- a/pkg/es/empty_test.go +++ b/pkg/es/empty_test.go @@ -17,9 +17,9 @@ package es import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/es/filter/package_test.go b/pkg/es/filter/package_test.go index d0643a88594..95fe8a65370 100644 --- a/pkg/es/filter/package_test.go +++ b/pkg/es/filter/package_test.go @@ -17,9 +17,9 @@ package filter import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/es/wrapper/empty_test.go b/pkg/es/wrapper/empty_test.go index 41a096bf192..a76a2dd052f 100644 --- a/pkg/es/wrapper/empty_test.go +++ b/pkg/es/wrapper/empty_test.go @@ -17,9 +17,9 @@ package eswrapper import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/fswatcher/fswatcher_test.go b/pkg/fswatcher/fswatcher_test.go index d61f591e900..68a431e9e02 100644 --- a/pkg/fswatcher/fswatcher_test.go +++ b/pkg/fswatcher/fswatcher_test.go @@ -23,10 +23,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "go.uber.org/zap" "go.uber.org/zap/zapcore" "go.uber.org/zap/zaptest/observer" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func createTestFiles(t *testing.T) (file1 string, file2 string, file3 string) { @@ -242,5 +243,5 @@ func assertLogs(t *testing.T, f func() bool, errorMsg string, logObserver *obser } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/gzipfs/gzip_test.go b/pkg/gzipfs/gzip_test.go index ef58453347c..a2902d7655f 100644 --- a/pkg/gzipfs/gzip_test.go +++ b/pkg/gzipfs/gzip_test.go @@ -24,7 +24,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) //go:embed testdata @@ -153,5 +154,5 @@ func TestFileRead(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/healthcheck/package_test.go b/pkg/healthcheck/package_test.go index 4da8b594261..bdfd3e8edda 100644 --- a/pkg/healthcheck/package_test.go +++ b/pkg/healthcheck/package_test.go @@ -17,9 +17,9 @@ package healthcheck import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/hostname/hostname_test.go b/pkg/hostname/hostname_test.go index 7d54f8abfca..dc45d2e692f 100644 --- a/pkg/hostname/hostname_test.go +++ b/pkg/hostname/hostname_test.go @@ -22,7 +22,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestAsIdentifier(t *testing.T) { @@ -51,5 +52,5 @@ func TestAsIdentifier(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/httpfs/prefixed_test.go b/pkg/httpfs/prefixed_test.go index edbc1479420..62fc844f142 100644 --- a/pkg/httpfs/prefixed_test.go +++ b/pkg/httpfs/prefixed_test.go @@ -20,7 +20,8 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) //go:embed test_assets/* @@ -48,5 +49,5 @@ func TestPrefixedFS(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/httpmetrics/metrics_test.go b/pkg/httpmetrics/metrics_test.go index 25371b360a9..b9c24455221 100644 --- a/pkg/httpmetrics/metrics_test.go +++ b/pkg/httpmetrics/metrics_test.go @@ -22,12 +22,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "go.uber.org/zap" "github.com/jaegertracing/jaeger/internal/metrics/prometheus" "github.com/jaegertracing/jaeger/internal/metricstest" "github.com/jaegertracing/jaeger/pkg/metrics" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestNewMetricsHandler(t *testing.T) { @@ -90,5 +90,5 @@ func TestIllegalPrometheusLabel(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/jtracer/jtracer_test.go b/pkg/jtracer/jtracer_test.go index 3b69f77b18a..403bf241d91 100644 --- a/pkg/jtracer/jtracer_test.go +++ b/pkg/jtracer/jtracer_test.go @@ -22,7 +22,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestNew(t *testing.T) { @@ -83,5 +84,5 @@ func TestInitHelperResourceError(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/kafka/auth/empty_test.go b/pkg/kafka/auth/empty_test.go index a3fda7a77f6..359794bd25c 100644 --- a/pkg/kafka/auth/empty_test.go +++ b/pkg/kafka/auth/empty_test.go @@ -17,9 +17,9 @@ package auth import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/kafka/consumer/empty_test.go b/pkg/kafka/consumer/empty_test.go index 287cb02e5b4..55136a0cff5 100644 --- a/pkg/kafka/consumer/empty_test.go +++ b/pkg/kafka/consumer/empty_test.go @@ -17,9 +17,9 @@ package consumer import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/kafka/producer/empty_test.go b/pkg/kafka/producer/empty_test.go index 3d8cc532bc7..9244adde33e 100644 --- a/pkg/kafka/producer/empty_test.go +++ b/pkg/kafka/producer/empty_test.go @@ -17,9 +17,9 @@ package producer import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/memory/config/empty_test.go b/pkg/memory/config/empty_test.go index f47f8fd6777..6557ace0cb9 100644 --- a/pkg/memory/config/empty_test.go +++ b/pkg/memory/config/empty_test.go @@ -17,9 +17,9 @@ package config import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/metrics/metrics_test.go b/pkg/metrics/metrics_test.go index ecdec6003c7..aa310bb2cc7 100644 --- a/pkg/metrics/metrics_test.go +++ b/pkg/metrics/metrics_test.go @@ -21,10 +21,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/internal/metricstest" "github.com/jaegertracing/jaeger/pkg/metrics" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestInitMetrics(t *testing.T) { @@ -146,5 +146,5 @@ func TestNullMetrics(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/netutils/port_test.go b/pkg/netutils/port_test.go index 123d91cd109..9c765540644 100644 --- a/pkg/netutils/port_test.go +++ b/pkg/netutils/port_test.go @@ -19,7 +19,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) type testAddr struct { @@ -76,5 +77,5 @@ func TestFixLocalhost(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/normalizer/service_name_test.go b/pkg/normalizer/service_name_test.go index e0b90bbf1cb..0a994498a2b 100644 --- a/pkg/normalizer/service_name_test.go +++ b/pkg/normalizer/service_name_test.go @@ -19,7 +19,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestServiceNameReplacer(t *testing.T) { @@ -29,5 +30,5 @@ func TestServiceNameReplacer(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/prometheus/config/empty_test.go b/pkg/prometheus/config/empty_test.go index b5e40db469a..2b7fcf4a4b8 100644 --- a/pkg/prometheus/config/empty_test.go +++ b/pkg/prometheus/config/empty_test.go @@ -17,9 +17,9 @@ package config import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/queue/bounded_queue_test.go b/pkg/queue/bounded_queue_test.go index a4973c118e3..270adc03252 100644 --- a/pkg/queue/bounded_queue_test.go +++ b/pkg/queue/bounded_queue_test.go @@ -25,10 +25,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/internal/metricstest" "github.com/jaegertracing/jaeger/pkg/metrics" + "github.com/jaegertracing/jaeger/pkg/testutils" ) // In this test we run a queue with capacity 1 and a single consumer. @@ -357,5 +357,5 @@ func BenchmarkBoundedQueueWithFactory(b *testing.B) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/recoveryhandler/zap_test.go b/pkg/recoveryhandler/zap_test.go index e39c1dff71f..eee6782d72a 100644 --- a/pkg/recoveryhandler/zap_test.go +++ b/pkg/recoveryhandler/zap_test.go @@ -22,7 +22,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/pkg/testutils" ) @@ -48,5 +47,5 @@ func TestNewRecoveryHandler(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/pkg/tenancy/package_test.go b/pkg/tenancy/package_test.go index 8fb8984f481..ea1644b3936 100644 --- a/pkg/tenancy/package_test.go +++ b/pkg/tenancy/package_test.go @@ -17,9 +17,9 @@ package tenancy import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/empty_test.go b/plugin/empty_test.go index 684aedffb30..5e8be8dbe54 100644 --- a/plugin/empty_test.go +++ b/plugin/empty_test.go @@ -17,9 +17,9 @@ package plugin import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/metrics/disabled/package_test.go b/plugin/metrics/disabled/package_test.go index 1877be9fbb6..3e418506d11 100644 --- a/plugin/metrics/disabled/package_test.go +++ b/plugin/metrics/disabled/package_test.go @@ -17,9 +17,9 @@ package disabled import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/metrics/package_test.go b/plugin/metrics/package_test.go index e98f5bce5e9..7316b97ab69 100644 --- a/plugin/metrics/package_test.go +++ b/plugin/metrics/package_test.go @@ -17,9 +17,9 @@ package metrics import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/metrics/prometheus/factory_test.go b/plugin/metrics/prometheus/factory_test.go index c30a8a354b9..db1374f280d 100644 --- a/plugin/metrics/prometheus/factory_test.go +++ b/plugin/metrics/prometheus/factory_test.go @@ -21,7 +21,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "go.uber.org/zap" "github.com/jaegertracing/jaeger/pkg/config" @@ -150,5 +149,5 @@ func TestFailedTLSOptions(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/metrics/prometheus/metricsstore/dbmodel/to_domain_test.go b/plugin/metrics/prometheus/metricsstore/dbmodel/to_domain_test.go index 5edf0471c71..ad14ed3f4c2 100644 --- a/plugin/metrics/prometheus/metricsstore/dbmodel/to_domain_test.go +++ b/plugin/metrics/prometheus/metricsstore/dbmodel/to_domain_test.go @@ -22,8 +22,8 @@ import ( "github.com/prometheus/common/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" ) @@ -82,5 +82,5 @@ func TestUnexpectedMetricsFamilyType(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/pkg/distributedlock/cassandra/lock_test.go b/plugin/pkg/distributedlock/cassandra/lock_test.go index caac0986c87..f542abdfc04 100644 --- a/plugin/pkg/distributedlock/cassandra/lock_test.go +++ b/plugin/pkg/distributedlock/cassandra/lock_test.go @@ -24,9 +24,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/pkg/cassandra/mocks" + "github.com/jaegertracing/jaeger/pkg/testutils" ) var ( @@ -272,5 +272,5 @@ func stringMatcher(q string) interface{} { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/sampling/calculationstrategy/package_test.go b/plugin/sampling/calculationstrategy/package_test.go index 7d9efa7120b..9d7751201a7 100644 --- a/plugin/sampling/calculationstrategy/package_test.go +++ b/plugin/sampling/calculationstrategy/package_test.go @@ -17,9 +17,9 @@ package calculationstrategy import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/sampling/leaderelection/leader_election_test.go b/plugin/sampling/leaderelection/leader_election_test.go index 8e914c397e9..50ee42c60af 100644 --- a/plugin/sampling/leaderelection/leader_election_test.go +++ b/plugin/sampling/leaderelection/leader_election_test.go @@ -23,7 +23,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" lmocks "github.com/jaegertracing/jaeger/pkg/distributedlock/mocks" "github.com/jaegertracing/jaeger/pkg/testutils" @@ -108,5 +107,5 @@ func TestRunAcquireLockLoopFollowerOnly(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/sampling/strategystore/package_test.go b/plugin/sampling/strategystore/package_test.go index 5a7963d512a..3cf20eab7f3 100644 --- a/plugin/sampling/strategystore/package_test.go +++ b/plugin/sampling/strategystore/package_test.go @@ -17,9 +17,9 @@ package strategystore import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/sampling/strategystore/static/package_test.go b/plugin/sampling/strategystore/static/package_test.go index 013dd2d20a4..f9c71a974bc 100644 --- a/plugin/sampling/strategystore/static/package_test.go +++ b/plugin/sampling/strategystore/static/package_test.go @@ -17,9 +17,9 @@ package static import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/badger/dependencystore/package_test.go b/plugin/storage/badger/dependencystore/package_test.go index a2d168f1f48..4f1376bb2d2 100644 --- a/plugin/storage/badger/dependencystore/package_test.go +++ b/plugin/storage/badger/dependencystore/package_test.go @@ -17,11 +17,9 @@ package dependencystore import ( "testing" - "go.uber.org/goleak" - "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m, testutils.IgnoreGlogFlushDaemonLeak()) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/badger/package_test.go b/plugin/storage/badger/package_test.go index 6fc584128b3..6a4015edb05 100644 --- a/plugin/storage/badger/package_test.go +++ b/plugin/storage/badger/package_test.go @@ -17,11 +17,9 @@ package badger import ( "testing" - "go.uber.org/goleak" - "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m, testutils.IgnoreGlogFlushDaemonLeak()) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/badger/samplingstore/storage_test.go b/plugin/storage/badger/samplingstore/storage_test.go index 69055ba9dd2..8b92a2ca43e 100644 --- a/plugin/storage/badger/samplingstore/storage_test.go +++ b/plugin/storage/badger/samplingstore/storage_test.go @@ -22,7 +22,6 @@ import ( "github.com/dgraph-io/badger/v3" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" samplemodel "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/model" "github.com/jaegertracing/jaeger/pkg/testutils" @@ -143,5 +142,5 @@ func runWithBadger(t *testing.T, test func(t *testing.T, store *SamplingStore)) } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m, testutils.IgnoreGlogFlushDaemonLeak()) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/badger/spanstore/package_test.go b/plugin/storage/badger/spanstore/package_test.go index a601b5f157b..5e5441f0904 100644 --- a/plugin/storage/badger/spanstore/package_test.go +++ b/plugin/storage/badger/spanstore/package_test.go @@ -17,11 +17,9 @@ package spanstore import ( "testing" - "go.uber.org/goleak" - "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m, testutils.IgnoreGlogFlushDaemonLeak()) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/blackhole/package_test.go b/plugin/storage/blackhole/package_test.go index 1136d3ae302..ffe35183034 100644 --- a/plugin/storage/blackhole/package_test.go +++ b/plugin/storage/blackhole/package_test.go @@ -17,9 +17,9 @@ package blackhole import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/cassandra/dependencystore/package_test.go b/plugin/storage/cassandra/dependencystore/package_test.go index 4c775041dc9..4f1376bb2d2 100644 --- a/plugin/storage/cassandra/dependencystore/package_test.go +++ b/plugin/storage/cassandra/dependencystore/package_test.go @@ -17,9 +17,9 @@ package dependencystore import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/cassandra/package_test.go b/plugin/storage/cassandra/package_test.go index 12ba121f44a..2ed5897a9a2 100644 --- a/plugin/storage/cassandra/package_test.go +++ b/plugin/storage/cassandra/package_test.go @@ -17,9 +17,9 @@ package cassandra import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/cassandra/samplingstore/storage_test.go b/plugin/storage/cassandra/samplingstore/storage_test.go index 251191c410b..eb571e5b648 100644 --- a/plugin/storage/cassandra/samplingstore/storage_test.go +++ b/plugin/storage/cassandra/samplingstore/storage_test.go @@ -24,7 +24,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "go.uber.org/zap" "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/model" @@ -394,5 +393,5 @@ func TestProbabilitiesSetToString(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/cassandra/spanstore/dbmodel/package_test.go b/plugin/storage/cassandra/spanstore/dbmodel/package_test.go index b7ad360ab64..aead19cf9ca 100644 --- a/plugin/storage/cassandra/spanstore/dbmodel/package_test.go +++ b/plugin/storage/cassandra/spanstore/dbmodel/package_test.go @@ -17,9 +17,9 @@ package dbmodel import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/cassandra/spanstore/package_test.go b/plugin/storage/cassandra/spanstore/package_test.go index 6212c985ef1..5e5441f0904 100644 --- a/plugin/storage/cassandra/spanstore/package_test.go +++ b/plugin/storage/cassandra/spanstore/package_test.go @@ -17,9 +17,9 @@ package spanstore import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/es/dependencystore/dbmodel/converter_test.go b/plugin/storage/es/dependencystore/dbmodel/converter_test.go index c82a9e274ac..76c3608eb84 100644 --- a/plugin/storage/es/dependencystore/dbmodel/converter_test.go +++ b/plugin/storage/es/dependencystore/dbmodel/converter_test.go @@ -19,9 +19,9 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/model" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestConvertDependencies(t *testing.T) { @@ -52,5 +52,5 @@ func TestConvertDependencies(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/es/dependencystore/storage_test.go b/plugin/storage/es/dependencystore/storage_test.go index 50fcb05708c..91d3e152186 100644 --- a/plugin/storage/es/dependencystore/storage_test.go +++ b/plugin/storage/es/dependencystore/storage_test.go @@ -27,7 +27,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "go.uber.org/zap" "github.com/jaegertracing/jaeger/model" @@ -298,5 +297,5 @@ func stringMatcher(q string) interface{} { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/es/mappings/mapping_test.go b/plugin/storage/es/mappings/mapping_test.go index 7d95c70e95c..562c8400f83 100644 --- a/plugin/storage/es/mappings/mapping_test.go +++ b/plugin/storage/es/mappings/mapping_test.go @@ -26,10 +26,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/pkg/es" "github.com/jaegertracing/jaeger/pkg/es/mocks" + "github.com/jaegertracing/jaeger/pkg/testutils" ) //go:embed fixtures/*.json @@ -333,5 +333,5 @@ func TestMappingBuilder_GetDependenciesMappings(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/es/package_test.go b/plugin/storage/es/package_test.go index f54340d7caa..776ff43b739 100644 --- a/plugin/storage/es/package_test.go +++ b/plugin/storage/es/package_test.go @@ -17,9 +17,9 @@ package es import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/es/spanstore/dbmodel/package_test.go b/plugin/storage/es/spanstore/dbmodel/package_test.go index b7ad360ab64..aead19cf9ca 100644 --- a/plugin/storage/es/spanstore/dbmodel/package_test.go +++ b/plugin/storage/es/spanstore/dbmodel/package_test.go @@ -17,9 +17,9 @@ package dbmodel import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/es/spanstore/package_test.go b/plugin/storage/es/spanstore/package_test.go index 6212c985ef1..5e5441f0904 100644 --- a/plugin/storage/es/spanstore/package_test.go +++ b/plugin/storage/es/spanstore/package_test.go @@ -17,9 +17,9 @@ package spanstore import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/grpc/config/empty_test.go b/plugin/storage/grpc/config/empty_test.go index f2f65cd0f1d..d215d0e7fa4 100644 --- a/plugin/storage/grpc/config/empty_test.go +++ b/plugin/storage/grpc/config/empty_test.go @@ -17,9 +17,9 @@ package config import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/grpc/memory/plugin_test.go b/plugin/storage/grpc/memory/plugin_test.go index 40ea0030ec8..7f9501ce29a 100644 --- a/plugin/storage/grpc/memory/plugin_test.go +++ b/plugin/storage/grpc/memory/plugin_test.go @@ -18,8 +18,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" "github.com/jaegertracing/jaeger/plugin/storage/memory" ) @@ -38,5 +38,5 @@ func TestPluginUsesMemoryStorage(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/grpc/package_test.go b/plugin/storage/grpc/package_test.go index 0a7103d2b21..4ea33c26a21 100644 --- a/plugin/storage/grpc/package_test.go +++ b/plugin/storage/grpc/package_test.go @@ -17,9 +17,9 @@ package grpc import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/grpc/proto/storage_v1/storage_test.go b/plugin/storage/grpc/proto/storage_v1/storage_test.go index eef8a2f261a..e9c4dd8b5d5 100644 --- a/plugin/storage/grpc/proto/storage_v1/storage_test.go +++ b/plugin/storage/grpc/proto/storage_v1/storage_test.go @@ -21,9 +21,9 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/model" + "github.com/jaegertracing/jaeger/pkg/testutils" "github.com/jaegertracing/jaeger/plugin/storage/grpc/proto/storageprototest" "github.com/jaegertracing/jaeger/proto-gen/storage_v1" ) @@ -119,5 +119,5 @@ func makeSpan(someKV model.KeyValue) model.Span { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/grpc/shared/package_test.go b/plugin/storage/grpc/shared/package_test.go index a611e311553..836973d16bc 100644 --- a/plugin/storage/grpc/shared/package_test.go +++ b/plugin/storage/grpc/shared/package_test.go @@ -17,9 +17,9 @@ package shared import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/kafka/package_test.go b/plugin/storage/kafka/package_test.go index b637ce3a2ca..0384c43a1ca 100644 --- a/plugin/storage/kafka/package_test.go +++ b/plugin/storage/kafka/package_test.go @@ -17,9 +17,9 @@ package kafka import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/memory/package_test.go b/plugin/storage/memory/package_test.go index a6c09a8622d..fa8c277bf7e 100644 --- a/plugin/storage/memory/package_test.go +++ b/plugin/storage/memory/package_test.go @@ -17,9 +17,9 @@ package memory import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/plugin/storage/package_test.go b/plugin/storage/package_test.go index 7627d753b67..0277f12796f 100644 --- a/plugin/storage/package_test.go +++ b/plugin/storage/package_test.go @@ -17,11 +17,9 @@ package storage import ( "testing" - "go.uber.org/goleak" - "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m, testutils.IgnoreGlogFlushDaemonLeak()) + testutils.VerifyGoLeaks(m) } diff --git a/ports/ports_test.go b/ports/ports_test.go index ae6de139fd5..a6dae7a4f18 100644 --- a/ports/ports_test.go +++ b/ports/ports_test.go @@ -19,7 +19,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.uber.org/goleak" + + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestPortToHostPort(t *testing.T) { @@ -54,5 +55,5 @@ func TestFormatHostPort(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/scripts/check-goleak-files.sh b/scripts/check-goleak-files.sh index 0b60389746c..278db449139 100755 --- a/scripts/check-goleak-files.sh +++ b/scripts/check-goleak-files.sh @@ -15,7 +15,7 @@ for dir in $*; do fi good=0 for test in ${testFiles}; do - if grep -q "TestMain" "${test}" | grep -q "goleak.VerifyTestMain" "${test}"; then + if grep -q "TestMain" "${test}" | grep -q "testutils.VerifyGoLeaks" "${test}"; then good=1 break fi diff --git a/storage/dependencystore/empty_test.go b/storage/dependencystore/empty_test.go index 44acb5c044f..ff98555f62a 100644 --- a/storage/dependencystore/empty_test.go +++ b/storage/dependencystore/empty_test.go @@ -17,9 +17,9 @@ package dependencystore import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/storage/empty_test.go b/storage/empty_test.go index bf1bf3dd5e4..350dc65a092 100644 --- a/storage/empty_test.go +++ b/storage/empty_test.go @@ -17,9 +17,9 @@ package storage import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/storage/metricsstore/empty_test.go b/storage/metricsstore/empty_test.go index fa2f0f56d15..bf4cf2a993c 100644 --- a/storage/metricsstore/empty_test.go +++ b/storage/metricsstore/empty_test.go @@ -17,9 +17,9 @@ package metricsstore import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/storage/metricsstore/metrics/decorator_test.go b/storage/metricsstore/metrics/decorator_test.go index 1b16ee23e2c..e005b85f4d2 100644 --- a/storage/metricsstore/metrics/decorator_test.go +++ b/storage/metricsstore/metrics/decorator_test.go @@ -21,9 +21,9 @@ import ( "time" "github.com/stretchr/testify/assert" - "go.uber.org/goleak" "github.com/jaegertracing/jaeger/internal/metricstest" + "github.com/jaegertracing/jaeger/pkg/testutils" protometrics "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" "github.com/jaegertracing/jaeger/storage/metricsstore" . "github.com/jaegertracing/jaeger/storage/metricsstore/metrics" @@ -155,5 +155,5 @@ func TestFailingUnderlyingCalls(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/storage/samplingstore/empty_test.go b/storage/samplingstore/empty_test.go index 00ed682e1fa..cc49191e5c8 100644 --- a/storage/samplingstore/empty_test.go +++ b/storage/samplingstore/empty_test.go @@ -17,9 +17,9 @@ package samplingstore import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/storage/spanstore/interface_test.go b/storage/spanstore/interface_test.go index 6212c985ef1..5e5441f0904 100644 --- a/storage/spanstore/interface_test.go +++ b/storage/spanstore/interface_test.go @@ -17,9 +17,9 @@ package spanstore import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) } diff --git a/storage/spanstore/metrics/package_test.go b/storage/spanstore/metrics/package_test.go index e98f5bce5e9..7316b97ab69 100644 --- a/storage/spanstore/metrics/package_test.go +++ b/storage/spanstore/metrics/package_test.go @@ -17,9 +17,9 @@ package metrics import ( "testing" - "go.uber.org/goleak" + "github.com/jaegertracing/jaeger/pkg/testutils" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + testutils.VerifyGoLeaks(m) }