diff --git a/server/http_handler_test.go b/server/http_handler_test.go index 03c3a846669f0..e47f8ce0fc87a 100644 --- a/server/http_handler_test.go +++ b/server/http_handler_test.go @@ -1198,7 +1198,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) { @@ -1239,5 +1241,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{} + }) }