mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Fix flaky test in historian (#89913)
This commit is contained in:
parent
71d31397e5
commit
559738ce6a
@ -861,11 +861,16 @@ func TestGetFolderUIDsForFilter(t *testing.T) {
|
||||
assert.Len(t, ac.Calls, len(folders)+1)
|
||||
assert.Equal(t, "CanReadAllRules", ac.Calls[0].MethodName)
|
||||
assert.Equal(t, usr, ac.Calls[0].Arguments[1])
|
||||
for i, folderUID := range folders {
|
||||
assert.Equal(t, "HasAccessInFolder", ac.Calls[i+1].MethodName)
|
||||
assert.Equal(t, usr, ac.Calls[i+1].Arguments[1])
|
||||
assert.Equal(t, folderUID, ac.Calls[i+1].Arguments[2].(models.Namespaced).GetNamespaceUID())
|
||||
|
||||
var called []string
|
||||
for _, call := range ac.Calls[1:] {
|
||||
if !assert.Equal(t, "HasAccessInFolder", call.MethodName) {
|
||||
continue
|
||||
}
|
||||
assert.Equal(t, usr, call.Arguments[1])
|
||||
called = append(called, call.Arguments[2].(models.Namespaced).GetNamespaceUID())
|
||||
}
|
||||
assert.ElementsMatch(t, folders, called)
|
||||
|
||||
t.Run("should fail if no folders to read", func(t *testing.T) {
|
||||
loki := createLoki(ac)
|
||||
|
Loading…
Reference in New Issue
Block a user