File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -719,7 +719,8 @@ func TestGetRules(t *testing.T) {
719
719
activeRulers := 0
720
720
for rID := range tc .tokensByRuler {
721
721
createAndStartRuler (rID )
722
- if tc .rulerState [rID ] == ring .ACTIVE {
722
+ state , ok := tc .rulerState [rID ]
723
+ if (ok && state == ring .ACTIVE ) || ! ok {
723
724
activeRulers ++
724
725
}
725
726
}
@@ -789,10 +790,7 @@ func TestGetRules(t *testing.T) {
789
790
for _ , g := range actualRules .Groups {
790
791
actualRuleDescs = append (actualRuleDescs , g .Group )
791
792
}
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 )
796
794
797
795
// Check call count for rulers (this verifies that JOINING rulers should be ignored).
798
796
mockPoolClient := r .clientsPool .(* mockRulerClientsPool )
You can’t perform that action at this time.
0 commit comments