From 99580d60f59fdac11f7323dfc1c90e8f4213fa3b Mon Sep 17 00:00:00 2001 From: Gabriel MABILLE Date: Mon, 4 Dec 2023 22:26:55 +0100 Subject: [PATCH] Chore: Fix flaky test by removing the extsvcauth background service (#79044) --- pkg/registry/backgroundsvcs/background_services.go | 4 +--- pkg/services/extsvcauth/registry/service.go | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pkg/registry/backgroundsvcs/background_services.go b/pkg/registry/backgroundsvcs/background_services.go index e58e6d0fe81..c2b0078087c 100644 --- a/pkg/registry/backgroundsvcs/background_services.go +++ b/pkg/registry/backgroundsvcs/background_services.go @@ -14,7 +14,6 @@ import ( "github.com/grafana/grafana/pkg/services/auth" "github.com/grafana/grafana/pkg/services/cleanup" "github.com/grafana/grafana/pkg/services/dashboardsnapshots" - extsvcreg "github.com/grafana/grafana/pkg/services/extsvcauth/registry" grafanaapiserver "github.com/grafana/grafana/pkg/services/grafana-apiserver" "github.com/grafana/grafana/pkg/services/grpcserver" "github.com/grafana/grafana/pkg/services/guardian" @@ -58,7 +57,7 @@ func ProvideBackgroundServiceRegistry( bundleService *supportbundlesimpl.Service, publicDashboardsMetric *publicdashboardsmetric.Service, keyRetriever *dynamic.KeyRetriever, dynamicAngularDetectorsProvider *angulardetectorsprovider.Dynamic, grafanaAPIServer grafanaapiserver.Service, - anon *anonimpl.AnonDeviceService, reg *extsvcreg.Registry, + anon *anonimpl.AnonDeviceService, // Need to make sure these are initialized, is there a better place to put them? _ dashboardsnapshots.Service, _ *alerting.AlertNotificationService, _ serviceaccounts.Service, _ *guardian.Provider, @@ -99,7 +98,6 @@ func ProvideBackgroundServiceRegistry( dynamicAngularDetectorsProvider, grafanaAPIServer, anon, - reg, ) } diff --git a/pkg/services/extsvcauth/registry/service.go b/pkg/services/extsvcauth/registry/service.go index d12528e7660..7348f607c6e 100644 --- a/pkg/services/extsvcauth/registry/service.go +++ b/pkg/services/extsvcauth/registry/service.go @@ -200,8 +200,8 @@ func (r *Registry) retrieveExtSvcProviders(ctx context.Context) (map[string]exts return extsvcs, nil } -func (r *Registry) Run(ctx context.Context) error { - // This is a one-time background job. - // Cleans up external services that have not been registered this time. - return r.CleanUpOrphanedExternalServices(ctx) -} +// func (r *Registry) Run(ctx context.Context) error { +// // This is a one-time background job. +// // Cleans up external services that have not been registered this time. +// return r.CleanUpOrphanedExternalServices(ctx) +// }