Add an assertion on the count of alerts before adding an active alert

Signed-off-by: gotjosh <josue.abreu@gmail.com>
This commit is contained in:
gotjosh 2024-04-30 12:17:56 +01:00
parent cc2207148e
commit 151f6e0ed6
No known key found for this signature in database
GPG key ID: A6E1DDE38FF3C74E

View file

@ -1038,6 +1038,8 @@ func TestAlertingRule_ActiveAlertsCount(t *testing.T) {
labels.EmptyLabels(), labels.EmptyLabels(), "", true, nil, labels.EmptyLabels(), labels.EmptyLabels(), "", true, nil,
) )
require.Equal(t, 0, rule.ActiveAlertsCount())
// Set an active alert. // Set an active alert.
lbls := labels.FromStrings("a1", "1") lbls := labels.FromStrings("a1", "1")
h := lbls.Hash() h := lbls.Hash()