Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expect a minimum of two nodes to be alive in test_graph #1192

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

Yadunund
Copy link
Member

Addresses #1189

Signed-off-by: Yadunund <yadunund@intrinsic.ai>
Copy link
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.

i think this is the correct check with do...while loop, because old_node is supposed to be invalid on rcl_shutdown.

* Calling this on a rcl_node_t makes it a valid node handle until rcl_shutdown
* is called or until rcl_node_fini is called on it.

@Yadunund
Copy link
Member Author

Signed-off-by: Yadunund <yadunund@intrinsic.ai>
@Yadunund Yadunund force-pushed the yadu/test_graph/fix_num_alive_nodes branch from a376365 to 996b588 Compare September 28, 2024 00:22
@Yadunund
Copy link
Member Author

CI is failing with rmw_fastrtps_cpp even for test cases unmodified in this PR. Is there a regression with FastDDS?

@fujitatomoya
Copy link
Collaborator

we suspected ros2/rmw_fastrtps@565bbc2 but ros2/rmw_fastrtps#780 looks fine with CI.

in Fast-DDS 2.14.x, there are few commits https://github.com/eProsima/Fast-DDS/commits/2.14.x/, but i am not sure which one triggers that.

@Yadunund
Copy link
Member Author

@fujitatomoya thanks for the insights. I will run CI on this PR after another review.

@YuanYuYuan
Copy link

Hi @Yadunund. I think we need to change the logic in rcl_action as well.

void WaitForAllNodesAlive()
{
rcl_ret_t ret;
rcutils_string_array_t node_names = rcutils_get_zero_initialized_string_array();
rcutils_string_array_t node_namespaces = rcutils_get_zero_initialized_string_array();
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
ret = rcutils_string_array_fini(&node_names);
ASSERT_EQ(RCUTILS_RET_OK, ret);
ret = rcutils_string_array_fini(&node_namespaces);
ASSERT_EQ(RCUTILS_RET_OK, ret);
});
// Wait for all 3 nodes to be discovered: remote_node, old_node, node
size_t attempts = 0u;
size_t max_attempts = 4u;
while (node_names.size < 3u) {
std::this_thread::sleep_for(std::chrono::seconds(1));
ret = rcl_get_node_names(&this->remote_node, allocator, &node_names, &node_namespaces);
++attempts;
ASSERT_LE(attempts, max_attempts) << "Unable to attain all required nodes";
if (node_names.size < 3u) {
ret = rcutils_string_array_fini(&node_names);
ASSERT_EQ(RCUTILS_RET_OK, ret);
ret = rcutils_string_array_fini(&node_namespaces);
ASSERT_EQ(RCUTILS_RET_OK, ret);
node_names = rcutils_get_zero_initialized_string_array();
node_namespaces = rcutils_get_zero_initialized_string_array();
}
}
}

After the change, we should conquer the failures in rcl_action test_graph.

Signed-off-by: Yadunund <yadunund@intrinsic.ai>
@Yadunund
Copy link
Member Author

Hi @Yadunund. I think we need to change the logic in rcl_action as well.

void WaitForAllNodesAlive()
{
rcl_ret_t ret;
rcutils_string_array_t node_names = rcutils_get_zero_initialized_string_array();
rcutils_string_array_t node_namespaces = rcutils_get_zero_initialized_string_array();
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
ret = rcutils_string_array_fini(&node_names);
ASSERT_EQ(RCUTILS_RET_OK, ret);
ret = rcutils_string_array_fini(&node_namespaces);
ASSERT_EQ(RCUTILS_RET_OK, ret);
});
// Wait for all 3 nodes to be discovered: remote_node, old_node, node
size_t attempts = 0u;
size_t max_attempts = 4u;
while (node_names.size < 3u) {
std::this_thread::sleep_for(std::chrono::seconds(1));
ret = rcl_get_node_names(&this->remote_node, allocator, &node_names, &node_namespaces);
++attempts;
ASSERT_LE(attempts, max_attempts) << "Unable to attain all required nodes";
if (node_names.size < 3u) {
ret = rcutils_string_array_fini(&node_names);
ASSERT_EQ(RCUTILS_RET_OK, ret);
ret = rcutils_string_array_fini(&node_namespaces);
ASSERT_EQ(RCUTILS_RET_OK, ret);
node_names = rcutils_get_zero_initialized_string_array();
node_namespaces = rcutils_get_zero_initialized_string_array();
}
}
}

After the change, we should conquer the failures in rcl_action test_graph.

Nice catch. Done 1ad5d9e

@clalancette
Copy link
Contributor

Pulls: #1192
Gist: https://gist.githubusercontent.com/clalancette/9c99ce9f776fd5378e610788e890ce4e/raw/af98cfe6a867bdd7473bff053cbcbfff72fcc363/ros2.repos
BUILD args: --packages-up-to rcl rcl_action
TEST args: --packages-select rcl rcl_action
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14638

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

@clalancette clalancette merged commit 8ddfd52 into rolling Oct 1, 2024
3 checks passed
@clalancette clalancette deleted the yadu/test_graph/fix_num_alive_nodes branch October 1, 2024 14:31
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.

6 participants