Remove duplicated sorted and assignment of expected alerts.

Signed-off-by: gotjosh <josue.abreu@gmail.com>
This commit is contained in:
gotjosh 2024-04-30 12:39:07 +01:00
parent 63b09944b8
commit f63dbc3db2
No known key found for this signature in database
GPG key ID: A6E1DDE38FF3C74E

View file

@ -397,14 +397,6 @@ func TestForStateRestore(t *testing.T) {
group.Eval(context.TODO(), evalTime) 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. // Prometheus goes down here. We create new rules and groups.
type testInput struct { type testInput struct {
name string name string