From d2b498c36986da7b65938264a7559fe92acf2d67 Mon Sep 17 00:00:00 2001 From: Jimmie Han Date: Thu, 18 Nov 2021 14:40:12 +0800 Subject: [PATCH] fix unit test ci Signed-off-by: Jimmie Han --- pkg/rules/manager_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/rules/manager_test.go b/pkg/rules/manager_test.go index 5fb8212a451..63158551462 100644 --- a/pkg/rules/manager_test.go +++ b/pkg/rules/manager_test.go @@ -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" @@ -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) }