Skip to content

Commit

Permalink
Prevent race condition in test causing it to fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanFabian committed Jan 20, 2021
1 parent 813f6a2 commit 9874b0f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/communication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,10 @@ TEST( Communication, actionClient )
ASSERT_NE( handle, nullptr );
EXPECT_NE( handle->commState(), action_comm_states::DONE );
EXPECT_TRUE( waitFor( [ &handle ]() { return handle->commState() == action_comm_states::ACTIVE; } ));
RosQml::getInstance().setThreads( 0 ); // Temporarily disable spinner to avoid race condition
handle->cancel();
EXPECT_EQ( handle->commState(), action_comm_states::WAITING_FOR_CANCEL_ACK );
RosQml::getInstance().setThreads( 8 );
EXPECT_TRUE( waitFor( [ &handle ]() { return handle->commState() == action_comm_states::DONE; } ));
terminal_state = handle->terminalState();
EXPECT_EQ( handle->terminalState().state(), action_terminal_states::PREEMPTED );
Expand Down

0 comments on commit 9874b0f

Please sign in to comment.