mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
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:
parent
cc2207148e
commit
151f6e0ed6
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue