Skip to content

Commit 5483824

Browse files
authored
Fix failure in bringup test (#740)
1 parent 3e38458 commit 5483824

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

doc/tutorials/quickstart_in_rviz/test/bringup_test.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <rclcpp/rclcpp.hpp>
66
#include <rclcpp_action/rclcpp_action.hpp>
77

8+
#include <chrono>
9+
#include <future>
810
#include <gtest/gtest.h>
911
#include <stdlib.h>
1012

@@ -71,7 +73,13 @@ TEST_F(BringupTestFixture, BasicBringupTest)
7173
};
7274
auto send_goal_options = rclcpp_action::Client<control_msgs::action::FollowJointTrajectory>::SendGoalOptions();
7375
send_goal_options.result_callback = result_cb;
74-
control_client->async_send_goal(joint_traj_request, send_goal_options);
76+
77+
// Ensure the status of executing the trajectory is not a timeout.
78+
auto goal_handle_future = control_client->async_send_goal(joint_traj_request, send_goal_options);
79+
ASSERT_NE(goal_handle_future.wait_for(std::chrono::seconds(5)), std::future_status::timeout);
80+
81+
// Sleeping for a bit helps prevent segfaults when shutting down the control node.
82+
std::this_thread::sleep_for(std::chrono::seconds(1));
7583
}
7684
} // namespace moveit2_tutorials::quickstart_in_rviz
7785

doc/tutorials/quickstart_in_rviz/test/bringup_test.test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def generate_test_description():
4343
),
4444
base_launch,
4545
# The test itself
46-
bringup_test,
4746
TimerAction(period=2.0, actions=[bringup_test]),
4847
launch_testing.actions.ReadyToTest(),
4948
]

0 commit comments

Comments
 (0)