From 29028717727b708a7807f8106eeea51c183924dd Mon Sep 17 00:00:00 2001 From: Suraj Nath <9503187+electron0zero@users.noreply.github.com> Date: Thu, 12 Oct 2023 02:12:18 +0530 Subject: [PATCH] fix panic in test --- modules/overrides/user_configurable_overrides_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/overrides/user_configurable_overrides_test.go b/modules/overrides/user_configurable_overrides_test.go index bdc763d5f71..5b44ca82716 100644 --- a/modules/overrides/user_configurable_overrides_test.go +++ b/modules/overrides/user_configurable_overrides_test.go @@ -18,6 +18,7 @@ import ( "github.com/grafana/tempo/pkg/util/listtomap" "github.com/grafana/tempo/tempodb/backend" "github.com/grafana/tempo/tempodb/backend/local" + "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -289,6 +290,8 @@ func localUserConfigOverrides(t *testing.T, baseLimits Overrides, PerTenantOverr baseOverrides, err := NewOverrides(baseCfg) assert.NoError(t, err) + // have to overwrite the registry or test panics with multiple metric reg + prometheus.DefaultRegisterer = prometheus.NewRegistry() configurableOverrides, err := newUserConfigOverrides(cfg, baseOverrides) assert.NoError(t, err)