diff --git a/src/app/reporting/SynchronizedReportSchedulerImpl.cpp b/src/app/reporting/SynchronizedReportSchedulerImpl.cpp index 5443df06a42045..909ca2a5c0dfb8 100644 --- a/src/app/reporting/SynchronizedReportSchedulerImpl.cpp +++ b/src/app/reporting/SynchronizedReportSchedulerImpl.cpp @@ -191,7 +191,8 @@ void SynchronizedReportSchedulerImpl::TimerFired() if (node->IsReportableNow(now)) { - // We assume we fired the timer early if no handler is reportable at the moment + // We set firedEarly false here because we assume we fired the timer early if no handler is reportable at the moment, + // which becomes false if we find a handler that is reportable firedEarly = false; node->SetEngineRunScheduled(true); ChipLogProgress(DataManagement, "Handler: %p with min: 0x" ChipLogFormatX64 " and max: 0x" ChipLogFormatX64 "", (node), diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index b32d3033301f5c..977ab022004b79 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -2343,6 +2343,7 @@ void TestReadInteraction::TestSubscribeEarlyReport(nlTestSuite * apSuite, void * NL_TEST_ASSERT(apSuite, gReportScheduler->IsReportScheduled(delegate.mpReadHandler)); NL_TEST_ASSERT(apSuite, !InteractionModelEngine::GetInstance()->GetReportingEngine().IsRunScheduled()); } + ctx.DrainAndServiceIO(); engine->Shutdown(); NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); @@ -2593,6 +2594,8 @@ void TestReadInteraction::TestSubscribeUrgentWildcardEvent(nlTestSuite * apSuite } } + ctx.DrainAndServiceIO(); + // By now we should have closed all exchanges and sent all pending acks, so // there should be no queued-up things in the retransmit table. NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0);