diff --git a/server/http_handler_test.go b/server/http_handler_test.go index ecf578f4a0f6b..926a5d99b6997 100644 --- a/server/http_handler_test.go +++ b/server/http_handler_test.go @@ -1196,7 +1196,9 @@ func TestSetLabels(t *testing.T) { testUpdateLabels(updated, labels) // reset the global variable - config.GetGlobalConfig().Labels = map[string]string{} + config.UpdateGlobal(func(conf *config.Config) { + conf.Labels = map[string]string{} + }) } func TestSetLabelsConcurrentWithGetLabel(t *testing.T) { @@ -1237,5 +1239,7 @@ func TestSetLabelsConcurrentWithGetLabel(t *testing.T) { close(done) // reset the global variable - config.GetGlobalConfig().Labels = map[string]string{} + config.UpdateGlobal(func(conf *config.Config) { + conf.Labels = map[string]string{} + }) }