From f63dbc3db2abee643c7e182690be5712c42f13ca Mon Sep 17 00:00:00 2001 From: gotjosh Date: Tue, 30 Apr 2024 12:39:07 +0100 Subject: [PATCH] Remove duplicated sorted and assignment of expected alerts. Signed-off-by: gotjosh --- rules/manager_test.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/rules/manager_test.go b/rules/manager_test.go index a3bd335d1..d74a7dfe1 100644 --- a/rules/manager_test.go +++ b/rules/manager_test.go @@ -397,14 +397,6 @@ func TestForStateRestore(t *testing.T) { group.Eval(context.TODO(), evalTime) } - exp := rule.ActiveAlerts() - for _, aa := range exp { - require.Zero(t, aa.Labels.Get(model.MetricNameLabel), "%s label set on active alert: %s", model.MetricNameLabel, aa.Labels) - } - sort.Slice(exp, func(i, j int) bool { - return labels.Compare(exp[i].Labels, exp[j].Labels) < 0 - }) - // Prometheus goes down here. We create new rules and groups. type testInput struct { name string