Skip to content

Commit

Permalink
Fix flaky PC commands test (#120)
Browse files Browse the repository at this point in the history
* debug pc commands; turn off some noisy prints; change assert to expect

Signed-off-by: Michael Anderson <[email protected]>

* switch back to testing all

Signed-off-by: Michael Anderson <[email protected]>
  • Loading branch information
andermi authored Jan 23, 2023
1 parent 914ea30 commit cb74bee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions buoy_tests/tests/fixture_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ TEST(BuoyTests, RunServer)
response->success = true;
return;
} else {
RCLCPP_INFO_STREAM(
RCLCPP_DEBUG_STREAM(
rclcpp::get_logger("run_server"),
"Incoming request\niterations: " << request->iterations);
}
Expand All @@ -123,7 +123,7 @@ TEST(BuoyTests, RunServer)

EXPECT_EQ(iterations - initial_iterations, request->iterations);

RCLCPP_INFO_STREAM(
RCLCPP_DEBUG_STREAM(
rclcpp::get_logger("run_server"),
"Response: " << std::boolalpha << response->success << std::noboolalpha);
}
Expand Down
8 changes: 4 additions & 4 deletions buoy_tests/tests/pc_commands_ros_feedback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ TEST_F(BuoyPCTests, PCCommandsInROSFeedback)

// Now send wind curr command
node->pc_wind_curr_response_future_ = node->send_pc_wind_curr_command(wc);
ASSERT_TRUE(node->pc_wind_curr_response_future_.valid());
EXPECT_TRUE(node->pc_wind_curr_response_future_.valid()) << "Winding Current future invalid!";
node->pc_wind_curr_response_future_.wait();
EXPECT_EQ(
node->pc_wind_curr_response_future_.get()->result.value,
Expand All @@ -334,7 +334,7 @@ TEST_F(BuoyPCTests, PCCommandsInROSFeedback)

// Now send scale command
node->pc_scale_response_future_ = node->send_pc_scale_command(scale);
ASSERT_TRUE(node->pc_scale_response_future_.valid());
EXPECT_TRUE(node->pc_scale_response_future_.valid()) << "Scale future invalid!";
node->pc_scale_response_future_.wait();
EXPECT_EQ(
node->pc_scale_response_future_.get()->result.value,
Expand All @@ -359,7 +359,7 @@ TEST_F(BuoyPCTests, PCCommandsInROSFeedback)

// Now send retract command
node->pc_retract_response_future_ = node->send_pc_retract_command(retract);
ASSERT_TRUE(node->pc_retract_response_future_.valid());
EXPECT_TRUE(node->pc_retract_response_future_.valid()) << "Retract future invalid!";
node->pc_retract_response_future_.wait();
EXPECT_EQ(
node->pc_retract_response_future_.get()->result.value,
Expand Down Expand Up @@ -408,7 +408,7 @@ TEST_F(BuoyPCTests, PCCommandsInROSFeedback)

// Now send bias curr command
node->pc_bias_curr_response_future_ = node->send_pc_bias_curr_command(bc);
ASSERT_TRUE(node->pc_bias_curr_response_future_.valid());
EXPECT_TRUE(node->pc_bias_curr_response_future_.valid()) << "Bias Current future invalid!";
node->pc_bias_curr_response_future_.wait();
EXPECT_EQ(
node->pc_bias_curr_response_future_.get()->result.value,
Expand Down

0 comments on commit cb74bee

Please sign in to comment.