Skip to content

Adressed TODO in node_graph#2877

Merged
ahcorde merged 5 commits intorollingfrom
ahcorde/rolling/todo1
Jun 30, 2025
Merged

Adressed TODO in node_graph#2877
ahcorde merged 5 commits intorollingfrom
ahcorde/rolling/todo1

Conversation

@ahcorde
Copy link
Copy Markdown
Contributor

@ahcorde ahcorde commented Jun 24, 2025

Adressed TODO in node_graph

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
@ahcorde ahcorde requested a review from fujitatomoya June 24, 2025 09:57
@ahcorde ahcorde self-assigned this Jun 24, 2025
ahcorde added 2 commits June 24, 2025 18:04
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
@ahcorde ahcorde requested a review from jmachowinski June 25, 2025 07:23
Copy link
Copy Markdown
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with green CI

@fujitatomoya
Copy link
Copy Markdown
Collaborator

fujitatomoya commented Jun 25, 2025

Pulls: #2877
Gist: https://gist.githubusercontent.com/fujitatomoya/4d242b9d39635a526f6c3d48427dd326/raw/c75ad2a42b7ad8d0e551b19baf352f892410f000/ros2.repos
BUILD args: --packages-above-and-dependencies rclcpp
TEST args: --packages-above rclcpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/16308

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde
Copy link
Copy Markdown
Contributor Author

ahcorde commented Jun 27, 2025

@jmachowinski Adding your last feedback the rcl_get_error_string() returns error not set. Are you fine if I restore these changes?

@jmachowinski
Copy link
Copy Markdown
Collaborator

That's odd, this would mean rcl does not set the error correctly, is this the reason why the TODOs were there in the first place ?

@jmachowinski
Copy link
Copy Markdown
Collaborator

I am deeply confused https://github.com/ros2/rcutils/blob/697ebd943c3438ffb9f20b64d07d1c9654a4c8d1/src/string_array.c#L68C5-L68C26
We set an error string here, why is it not returned by rcl_get_error_string ?

@jmachowinski
Copy link
Copy Markdown
Collaborator

jmachowinski commented Jun 27, 2025

Ahh figured it out, this happens because the test mocks and fails rcutils_string_array_fini

I guess we need to patch the test case as well and use patch_to_fail instead of patch_and_return

TEST_F(TestNodeGraph, get_node_names_and_namespaces_fini_errors)
{
  auto mock_names_fini = mocking_utils::patch_to_fail(
    "lib:rclcpp", rcutils_string_array_fini, "string_array is null", RCL_RET_ERROR);
  RCLCPP_EXPECT_THROW_EQ(
    node_graph()->get_node_names_and_namespaces(),
    std::runtime_error("could not destroy node names, could not destroy node namespaces : string_array is null"));
}

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
@ahcorde
Copy link
Copy Markdown
Contributor Author

ahcorde commented Jun 27, 2025

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde ahcorde merged commit e677f4c into rolling Jun 30, 2025
2 of 3 checks passed
@ahcorde ahcorde deleted the ahcorde/rolling/todo1 branch June 30, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants