From 30fb1b6b55ca8a99a718211a1411480e94de5899 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 10 Jul 2023 14:59:05 -0400 Subject: [PATCH] Increase our "waiting for subscription to time out" timer slack. 100ms is not enough: we have tests losing the timeslice for that long, and then we break out of our "waiting for timeout" loop before we process the firing of the timeout timer. Fixes https://github.com/project-chip/connectedhomeip/issues/27829 --- src/controller/tests/data_model/TestRead.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index 7be8008b7d7c9a..4bf94757e835e0 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -4645,14 +4645,15 @@ void TestReadInteraction::TestReadHandler_KeepSubscriptionTest(nlTestSuite * apS System::Clock::Timeout TestReadInteraction::ComputeSubscriptionTimeout(System::Clock::Seconds16 aMaxInterval) { - // Add 100ms of slack to our max interval to make sure we hit the - // subscription liveness timer. + // Add 1000ms of slack to our max interval to make sure we hit the + // subscription liveness timer. 100ms was tried in the past and is not + // sufficient: our process can easily lose the timeslice for 100ms. const auto & ourMrpConfig = GetDefaultMRPConfig(); auto publisherTransmissionTimeout = GetRetransmissionTimeout(ourMrpConfig.mActiveRetransTimeout, ourMrpConfig.mIdleRetransTimeout, System::SystemClock().GetMonotonicTimestamp(), Transport::kMinActiveTime); - return publisherTransmissionTimeout + aMaxInterval + System::Clock::Milliseconds32(100); + return publisherTransmissionTimeout + aMaxInterval + System::Clock::Milliseconds32(1000); } // clang-format off