Skip to content

Commit a889411

Browse files
committed
Updates from PR comments
1 parent fb83673 commit a889411

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pkg/ruler/ruler_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,8 @@ func TestGetRules(t *testing.T) {
719719
activeRulers := 0
720720
for rID := range tc.tokensByRuler {
721721
createAndStartRuler(rID)
722-
if tc.rulerState[rID] == ring.ACTIVE {
722+
state, ok := tc.rulerState[rID]
723+
if (ok && state == ring.ACTIVE) || !ok {
723724
activeRulers++
724725
}
725726
}
@@ -789,10 +790,7 @@ func TestGetRules(t *testing.T) {
789790
for _, g := range actualRules.Groups {
790791
actualRuleDescs = append(actualRuleDescs, g.Group)
791792
}
792-
sort.Slice(actualRuleDescs, func(i, j int) bool {
793-
return actualRuleDescs[i].Name < actualRuleDescs[j].Name
794-
})
795-
require.Equal(t, expectedRuleDescs, actualRuleDescs)
793+
require.ElementsMatch(t, expectedRuleDescs, actualRuleDescs)
796794

797795
// Check call count for rulers (this verifies that JOINING rulers should be ignored).
798796
mockPoolClient := r.clientsPool.(*mockRulerClientsPool)

0 commit comments

Comments
 (0)