Skip to content

Commit 00be280

Browse files
committed
chore(tests): fix incorrect types test assertion
This commit changes an incorrect assertion that a suppressed silenced alert is marked as active. Change-Id: 86e470c80eb5aa3fd59b32374e664ee2 Relates-To: prometheus#4315 Signed-Off-By: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>
1 parent 6ecd006 commit 00be280

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

types/types_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,19 @@ func TestMemMarker_Count(t *testing.T) {
127127
require.Equal(t, 1, countByState(AlertStateActive))
128128
require.Equal(t, 1, countTotal())
129129

130-
// Insert a suppressed alert.
130+
// Insert a silenced alert.
131131
marker.SetActiveOrSilenced(a2.Fingerprint(), 1, []string{"1"}, nil)
132132
require.Equal(t, 1, countByState(AlertStateSuppressed))
133133
require.Equal(t, 2, countTotal())
134134

135-
// Insert a resolved alert - it'll count as active.
135+
// Insert a resolved silenced alert - it'll count as suppressed.
136136
marker.SetActiveOrSilenced(a3.Fingerprint(), 1, []string{"1"}, nil)
137-
require.Equal(t, 1, countByState(AlertStateActive))
137+
require.Equal(t, 2, countByState(AlertStateSuppressed))
138+
require.Equal(t, 3, countTotal())
139+
140+
// Remove the silence from a3 - it'll count as active.
141+
marker.SetActiveOrSilenced(a3.Fingerprint(), 1, nil, nil)
142+
require.Equal(t, 2, countByState(AlertStateActive))
138143
require.Equal(t, 3, countTotal())
139144
}
140145

0 commit comments

Comments
 (0)