Skip to content

Commit

Permalink
Increase our "waiting for subscription to time out" timer slack. (#27870
Browse files Browse the repository at this point in the history
)

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 #27829
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jan 13, 2024
1 parent 8df26e3 commit 1958962
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/controller/tests/data_model/TestRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1958962

Please sign in to comment.