Skip to content

Commit

Permalink
Change the subscription timeout in the tests to 5ms (#1219)
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor authored Jul 18, 2024
1 parent 96a8d57 commit f7b1af1
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class AckermannSteeringControllerFixture : public ::testing::Test
while (max_sub_check_loop_count--)
{
controller_->update(rclcpp::Time(0, 0, RCL_ROS_TIME), rclcpp::Duration::from_seconds(0.01));
const auto timeout = std::chrono::milliseconds{1};
const auto timeout = std::chrono::milliseconds{5};
const auto until = test_subscription_node.get_clock()->now() + timeout;
while (!received_msg && test_subscription_node.get_clock()->now() < until)
{
Expand Down
2 changes: 1 addition & 1 deletion admittance_controller/test/test_admittance_controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class AdmittanceControllerTest : public ::testing::Test
controller_interface::return_type::OK);

// wait for message to be passed
const auto timeout = std::chrono::milliseconds{1};
const auto timeout = std::chrono::milliseconds{5};
const auto until = test_subscription_node_->get_clock()->now() + timeout;
while (!received_msg && test_subscription_node_->get_clock()->now() < until)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class BicycleSteeringControllerFixture : public ::testing::Test
while (max_sub_check_loop_count--)
{
controller_->update(rclcpp::Time(0, 0, RCL_ROS_TIME), rclcpp::Duration::from_seconds(0.01));
const auto timeout = std::chrono::milliseconds{1};
const auto timeout = std::chrono::milliseconds{5};
const auto until = test_subscription_node.get_clock()->now() + timeout;
while (!received_msg && test_subscription_node.get_clock()->now() < until)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void ForceTorqueSensorBroadcasterTest::subscribe_and_get_message(
while (max_sub_check_loop_count--)
{
fts_broadcaster_->update(rclcpp::Time(0), rclcpp::Duration::from_seconds(0.01));
const auto timeout = std::chrono::milliseconds{1};
const auto timeout = std::chrono::milliseconds{5};
const auto until = test_subscription_node.get_clock()->now() + timeout;
while (!received_msg && test_subscription_node.get_clock()->now() < until)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void IMUSensorBroadcasterTest::subscribe_and_get_message(sensor_msgs::msg::Imu &
while (max_sub_check_loop_count--)
{
imu_broadcaster_->update(rclcpp::Time(0), rclcpp::Duration::from_seconds(0.01));
const auto timeout = std::chrono::milliseconds{1};
const auto timeout = std::chrono::milliseconds{5};
const auto until = test_subscription_node.get_clock()->now() + timeout;
while (!received_msg && test_subscription_node.get_clock()->now() < until)
{
Expand Down
4 changes: 2 additions & 2 deletions joint_state_broadcaster/test/test_joint_state_broadcaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ void JointStateBroadcasterTest::activate_and_get_joint_state_message(
while (max_sub_check_loop_count--)
{
state_broadcaster_->update(rclcpp::Time(0), rclcpp::Duration::from_seconds(0.01));
const auto timeout = std::chrono::milliseconds{1};
const auto timeout = std::chrono::milliseconds{5};
const auto until = test_node.get_clock()->now() + timeout;
while (!received_msg && test_node.get_clock()->now() < until)
{
Expand Down Expand Up @@ -755,7 +755,7 @@ void JointStateBroadcasterTest::test_published_dynamic_joint_state_message(
while (max_sub_check_loop_count--)
{
state_broadcaster_->update(rclcpp::Time(0), rclcpp::Duration::from_seconds(0.01));
const auto timeout = std::chrono::milliseconds{1};
const auto timeout = std::chrono::milliseconds{5};
const auto until = test_node.get_clock()->now() + timeout;
while (test_node.get_clock()->now() < until)
{
Expand Down
2 changes: 1 addition & 1 deletion pid_controller/test/test_pid_controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class PidControllerFixture : public ::testing::Test
while (max_sub_check_loop_count--)
{
controller_->update(rclcpp::Time(0, 0, RCL_ROS_TIME), rclcpp::Duration::from_seconds(0.01));
const auto timeout = std::chrono::milliseconds{1};
const auto timeout = std::chrono::milliseconds{5};
const auto until = test_subscription_node.get_clock()->now() + timeout;
while (!received_msg && test_subscription_node.get_clock()->now() < until)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void RangeSensorBroadcasterTest::subscribe_and_get_message(sensor_msgs::msg::Ran
while (max_sub_check_loop_count--)
{
range_broadcaster_->update(rclcpp::Time(0), rclcpp::Duration::from_seconds(0.01));
const auto timeout = std::chrono::milliseconds{1};
const auto timeout = std::chrono::milliseconds{5};
const auto until = test_subscription_node.get_clock()->now() + timeout;
while (!received_msg && test_subscription_node.get_clock()->now() < until)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class SteeringControllersLibraryFixture : public ::testing::Test
while (max_sub_check_loop_count--)
{
controller_->update(rclcpp::Time(0, 0, RCL_ROS_TIME), rclcpp::Duration::from_seconds(0.01));
const auto timeout = std::chrono::milliseconds{1};
const auto timeout = std::chrono::milliseconds{5};
const auto until = test_subscription_node.get_clock()->now() + timeout;
while (!received_msg && test_subscription_node.get_clock()->now() < until)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class TricycleSteeringControllerFixture : public ::testing::Test
while (max_sub_check_loop_count--)
{
controller_->update(rclcpp::Time(0, 0, RCL_ROS_TIME), rclcpp::Duration::from_seconds(0.01));
const auto timeout = std::chrono::milliseconds{1};
const auto timeout = std::chrono::milliseconds{5};
const auto until = test_subscription_node.get_clock()->now() + timeout;
while (!received_msg && test_subscription_node.get_clock()->now() < until)
{
Expand Down

0 comments on commit f7b1af1

Please sign in to comment.