Skip to content

Commit

Permalink
Fix default route race condition UT (sonic-net#258)
Browse files Browse the repository at this point in the history
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
  • Loading branch information
lolyu authored and mssonicbld committed Jun 26, 2024
1 parent bf96984 commit 5c416c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/LinkManagerStateMachineTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1551,17 +1551,17 @@ TEST_F(LinkManagerStateMachineTest, DefaultRouteStateRaceCondition)
runIoServiceThreaded(3);

mMuxConfig.enableDefaultRouteFeature(true);
for (int i = 0; i < 10000; ++i)
for (uint i = 0; i < 10000; ++i)
{
MUXLOGDEBUG(boost::format("Iteration %d") % i);
mFakeMuxPort.handleDefaultRouteState("na");
mFakeMuxPort.handleDefaultRouteState("ok");

int check = 0;
while (((mFakeMuxPort.mFakeLinkProber->mShutdownTxProbeCallCount < i + 1) ||
(mFakeMuxPort.mFakeLinkProber->mRestartTxProbeCallCount < i + 1)) && (check < 10))
(mFakeMuxPort.mFakeLinkProber->mRestartTxProbeCallCount < i + 1)) && (check < 4000))
{
usleep(1000);
usleep(2000);
++check;
}

Expand Down

0 comments on commit 5c416c3

Please sign in to comment.