@@ -468,6 +468,42 @@ TEST_F(TestGenericClientAgainstServer, async_send_goal_no_callbacks)
468
468
EXPECT_FALSE (goal_handle->is_result_aware ());
469
469
}
470
470
471
+ TEST_F (TestGenericClientAgainstServer, receive_status_before_service_response)
472
+ {
473
+ auto action_generic_client = rclcpp_action::create_generic_client (
474
+ client_node,
475
+ action_name,
476
+ " test_msgs/action/Fibonacci" );
477
+ ASSERT_TRUE (action_generic_client->wait_for_action_server (WAIT_FOR_SERVER_TIMEOUT));
478
+
479
+ ActionGoal good_goal;
480
+ good_goal.order = 5 ;
481
+ auto future_goal_handle =
482
+ action_generic_client->async_send_goal (&good_goal, sizeof (good_goal));
483
+ // Spin the client, to send out the goals
484
+ client_executor.spin_some ();
485
+ // Spin the server until a goal is received
486
+ while (goals.empty ()) {
487
+ server_executor.spin_once ();
488
+ }
489
+ // Set the goals to an executing state
490
+ ActionStatusMessage status_message;
491
+ for (const auto & [goal_uuid, goal] : goals) {
492
+ rclcpp_action::GoalStatus goal_status;
493
+ goal_status.goal_info .goal_id .uuid = goal.first ->goal_id .uuid ;
494
+ goal_status.goal_info .stamp = goal.second ->stamp ;
495
+ goal_status.status = rclcpp_action::GoalStatus::STATUS_EXECUTING;
496
+ status_message.status_list .push_back (goal_status);
497
+ }
498
+ status_publisher->publish (status_message);
499
+ // Spin until the client receives the goal
500
+ dual_spin_until_future_complete (future_goal_handle);
501
+ auto goal_handle = future_goal_handle.get ();
502
+ EXPECT_EQ (rclcpp_action::GoalStatus::STATUS_EXECUTING, goal_handle->get_status ());
503
+ EXPECT_FALSE (goal_handle->is_feedback_aware ());
504
+ EXPECT_FALSE (goal_handle->is_result_aware ());
505
+ }
506
+
471
507
TEST_F (TestGenericClientAgainstServer, async_send_goal_request_no_callbacks)
472
508
{
473
509
auto action_generic_client = rclcpp_action::create_generic_client (
0 commit comments