Skip to content

Commit

Permalink
fix unit test ci
Browse files Browse the repository at this point in the history
Signed-off-by: Jimmie Han <hanjinming@outlook.com>
  • Loading branch information
hanjm committed Nov 18, 2021
1 parent 7b1ee8d commit d2b498c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/rules/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ func TestManagerRunRulesWithRuleGroupLimit(t *testing.T) {
testutil.Ok(t, ioutil.WriteFile(filename, []byte(`
groups:
- name: "something1"
interval: 1ms
limit: 1
rules:
- alert: "some"
Expand Down Expand Up @@ -448,7 +449,7 @@ groups:
testutil.Equals(t, 1, len(thanosRuleMgr.protoRuleGroups()))
testutil.Equals(t, 1, len(thanosRuleMgr.protoRuleGroups()[0].Rules))
testutil.Equals(t, string(rules.HealthUnknown), thanosRuleMgr.protoRuleGroups()[0].Rules[0].GetAlert().Health)
time.Sleep(time.Millisecond * 2)
time.Sleep(time.Millisecond * 5)
testutil.Equals(t, string(rules.HealthBad), thanosRuleMgr.protoRuleGroups()[0].Rules[0].GetAlert().Health)
testutil.Equals(t, "exceeded limit of 1 with 2 alerts", thanosRuleMgr.protoRuleGroups()[0].Rules[0].GetAlert().LastError)
}

0 comments on commit d2b498c

Please sign in to comment.