Skip to content

Commit

Permalink
Update rclcpp_action/test/test_client.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Lalancette <[email protected]>
  • Loading branch information
jmachowinski and clalancette authored Sep 7, 2023
1 parent 58295b0 commit 36b2825
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rclcpp_action/test/test_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,9 +910,9 @@ TEST_F(TestClientAgainstServer, deadlock_in_callbacks)
no_deadlock = true;
});

auto curTime = std::chrono::system_clock::now();
auto start_time = std::chrono::system_clock::now();

while (std::chrono::system_clock::now() - curTime < std::chrono::milliseconds(2000) &&
while (std::chrono::system_clock::now() - start_time < std::chrono::milliseconds(2000) &&
!no_deadlock)
{
std::this_thread::sleep_for(std::chrono::milliseconds(10));
Expand All @@ -921,8 +921,8 @@ TEST_F(TestClientAgainstServer, deadlock_in_callbacks)
if (no_deadlock) {
tr.join();
} else {
// in case of a failure, the thread is assumed to be in a deadlock,
// there we just drop then handle, so that we don't to block further tests
// In case of a failure, the thread is assumed to be in a deadlock.
// We detach the thread so we don't block further tests.
tr.detach();
}

Expand Down

0 comments on commit 36b2825

Please sign in to comment.