@@ -291,33 +291,28 @@ BOOST_AUTO_TEST_CASE(notify_after_multiple_state_changes_outside_timeperiod)
291291 NotificationTimerHandler ();
292292 REQUIRE_FALSE_WITHIN (GetNotificationCount () > 1 , 10ms);
293293 BOOST_REQUIRE_EQUAL (GetLastNotification (), NotificationProblem);
294- // NOTE: This is the bug. The timer run above has reset the suppressed ServiceOK event
295- BOOST_REQUIRE_EQUAL (GetSuppressedNotifications (), 0 );
294+ BOOST_REQUIRE_EQUAL (GetSuppressedNotifications (), NotificationRecovery);
296295
297296 // Third Critical check result will set the Critical hard state.
298297 ReceiveCheckResults (2 , ServiceCritical);
299298 REQUIRE_FALSE_WITHIN (GetNotificationCount () > 1 , 10ms);
300299 BOOST_REQUIRE_EQUAL (GetLastNotification (), NotificationProblem);
301- BOOST_REQUIRE_EQUAL (GetSuppressedNotifications (), NotificationProblem );
300+ BOOST_REQUIRE_EQUAL (GetSuppressedNotifications (), 0 );
302301
303302 NotificationTimerHandler ();
304303 REQUIRE_FALSE_WITHIN (GetNotificationCount () > 1 , 10ms);
305304 BOOST_REQUIRE_EQUAL (GetLastNotification (), NotificationProblem);
306- BOOST_REQUIRE_EQUAL (GetSuppressedNotifications (), NotificationProblem );
305+ BOOST_REQUIRE_EQUAL (GetSuppressedNotifications (), 0 );
307306
308307 ReceiveCheckResults (1 , ServiceOK);
309308 REQUIRE_FALSE_WITHIN (GetNotificationCount () > 1 , 10ms);
310309 BOOST_REQUIRE_EQUAL (GetLastNotification (), NotificationProblem);
311- BOOST_REQUIRE_EQUAL (GetSuppressedNotifications (), 0 );
310+ BOOST_REQUIRE_EQUAL (GetSuppressedNotifications (), NotificationRecovery );
312311
313- // Resonably we would now expect a NotificationRecovered, but it will not arrive due to the bug.
314312 BeginTimePeriod ();
315-
316- // No notification will be received because the suppressed notifications got borked
317- // when they were cleared previously in FireSuppressedNotifications()
318313 NotificationTimerHandler ();
319- REQUIRE_FALSE_WITHIN (GetNotificationCount () > 1 , 10ms);
320- BOOST_REQUIRE_EQUAL (GetLastNotification (), NotificationProblem );
314+ REQUIRE_TRUE_WITHIN (GetNotificationCount () == 2 , 10ms);
315+ BOOST_REQUIRE_EQUAL (GetLastNotification (), NotificationRecovery );
321316 BOOST_REQUIRE_EQUAL (GetSuppressedNotifications (), 0 );
322317}
323318
0 commit comments