fix: testutil blocking PR checks from passing (#101527)

This commit is contained in:
Charandas 2025-03-03 10:56:30 -08:00 committed by GitHub
parent dc61bf0855
commit cedb4ef9c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

2
go.mod
View File

@ -515,7 +515,7 @@ require (
go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect
go.etcd.io/etcd/client/v3 v3.5.16 // indirect go.etcd.io/etcd/client/v3 v3.5.16 // indirect
go.mongodb.org/mongo-driver v1.16.1 // indirect go.mongodb.org/mongo-driver v1.16.1 // indirect
go.opencensus.io v0.24.0 // indirect go.opencensus.io v0.24.0 // @grafana/grafana-backend-group
go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.33.0 // indirect go.opentelemetry.io/contrib/detectors/gcp v1.33.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect

View File

@ -7,12 +7,14 @@ import (
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.opencensus.io/stats/view"
"go.uber.org/goleak" "go.uber.org/goleak"
"github.com/grafana/grafana/pkg/util/testutil/mocks" "github.com/grafana/grafana/pkg/util/testutil/mocks"
) )
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
view.Stop()
// make sure we don't leak goroutines after tests in this package have // make sure we don't leak goroutines after tests in this package have
// finished, which means we haven't leaked contexts either // finished, which means we haven't leaked contexts either
goleak.VerifyTestMain(m) goleak.VerifyTestMain(m)