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 Mar 15, 2024
1 parent de93f6b commit 1091280
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 1091280

Please sign in to comment.