Skip to content

Commit

Permalink
Increase the timer slack TestRead allows to 100ms. (#27443)
Browse files Browse the repository at this point in the history
We're polling until a timer fires, but due to other threads losing the timeslice
for a while we could decide it's not firing when it's just been blocked on the
scheduler.  To reduce the risk of that, give it a bit more time to fire.

Fixes #27438
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Sep 26, 2023
1 parent 9b8fdf9 commit e8f2957
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/controller/tests/data_model/TestRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4645,14 +4645,14 @@ void TestReadInteraction::TestReadHandler_KeepSubscriptionTest(nlTestSuite * apS

System::Clock::Timeout TestReadInteraction::ComputeSubscriptionTimeout(System::Clock::Seconds16 aMaxInterval)
{
// Add 50ms of slack to our max interval to make sure we hit the
// Add 100ms of slack to our max interval to make sure we hit the
// subscription liveness timer.
const auto & ourMrpConfig = GetDefaultMRPConfig();
auto publisherTransmissionTimeout =
GetRetransmissionTimeout(ourMrpConfig.mActiveRetransTimeout, ourMrpConfig.mIdleRetransTimeout,
System::SystemClock().GetMonotonicTimestamp(), Transport::kMinActiveTime);

return publisherTransmissionTimeout + aMaxInterval + System::Clock::Milliseconds32(50);
return publisherTransmissionTimeout + aMaxInterval + System::Clock::Milliseconds32(100);
}

// clang-format off
Expand Down

0 comments on commit e8f2957

Please sign in to comment.