Skip to content

Commit

Permalink
add test check timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Doisy committed Dec 15, 2020
1 parent 6ead525 commit c9e2141
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/integration/diff_drive_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,14 @@ TEST_P(DiffDriveTest, OdomFrameId)

server.Run(true, 100, false);

int sleep = 0;
int maxSleep = 30;
for (; odomPosesCount < 5 && sleep < maxSleep; ++sleep)
{
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
ASSERT_NE(maxSleep, sleep);

EXPECT_EQ(5u, odomPosesCount);
}

Expand Down Expand Up @@ -398,6 +406,14 @@ TEST_P(DiffDriveTest, OdomCustomFrameId)

server.Run(true, 100, false);

int sleep = 0;
int maxSleep = 30;
for (; odomPosesCount < 5 && sleep < maxSleep; ++sleep)
{
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
ASSERT_NE(maxSleep, sleep);

EXPECT_EQ(5u, odomPosesCount);
}

Expand Down

0 comments on commit c9e2141

Please sign in to comment.