Skip to content

Commit

Permalink
wait for handler to be executed before checking
Browse files Browse the repository at this point in the history
  • Loading branch information
zjswhhh committed Aug 8, 2022
1 parent c4e534d commit ea207a8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/MuxManagerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,12 +1004,14 @@ TEST_F(MuxManagerTest, DbInterfaceRaceConditionCheck)

createPort("Ethernet0");

uint32_t TOGGLE_COUNT = 2000;
uint32_t TOGGLE_COUNT = 1000;

for (int i=0; i<TOGGLE_COUNT; i++) {
for (uint32_t i=0; i<TOGGLE_COUNT; i++) {
postMetricsEvent("Ethernet0", mux_state::MuxState::Label::Active);
setMuxState("Ethernet0", mux_state::MuxState::Label::Active);


// wait for handler to be completed
usleep(100);
EXPECT_FALSE(mDbInterfacePtr->mDbInterfaceRaceConditionCheckFailure);
}
EXPECT_EQ(mDbInterfacePtr->mSetMuxStateInvokeCount, TOGGLE_COUNT);
Expand Down

0 comments on commit ea207a8

Please sign in to comment.