mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
chore(tests): return a copy of the map to avoid concurrency issues in tests (#58547)
This commit is contained in:
parent
2bfdda5b68
commit
70dac35348
@ -93,6 +93,9 @@ func (repo *fakeAnnotationsRepo) Len() int {
|
|||||||
func (repo *fakeAnnotationsRepo) Items() map[int64]annotations.Item {
|
func (repo *fakeAnnotationsRepo) Items() map[int64]annotations.Item {
|
||||||
repo.mtx.Lock()
|
repo.mtx.Lock()
|
||||||
defer repo.mtx.Unlock()
|
defer repo.mtx.Unlock()
|
||||||
|
ret := make(map[int64]annotations.Item)
|
||||||
return repo.annotations
|
for k, v := range repo.annotations {
|
||||||
|
ret[k] = v
|
||||||
|
}
|
||||||
|
return ret
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user