Skip to content

Commit

Permalink
*: Fix data race in TestSetLabelsConcurrentWithGetLabel (#45579) (#45588
Browse files Browse the repository at this point in the history
)

close #45578
  • Loading branch information
ti-chi-bot authored Jul 27, 2023
1 parent 5a5cad1 commit da1e947
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/http_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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{}
})
}

0 comments on commit da1e947

Please sign in to comment.