Skip to content

fix(rcl_action): use RMW isolation for cross-node tests#1311

Merged
ahcorde merged 1 commit into
ros2:rollingfrom
YuanYuYuan:fix/action-graph-isolation
Apr 1, 2026
Merged

fix(rcl_action): use RMW isolation for cross-node tests#1311
ahcorde merged 1 commit into
ros2:rollingfrom
YuanYuYuan:fix/action-graph-isolation

Conversation

@YuanYuYuan
Copy link
Copy Markdown
Contributor

@YuanYuYuan YuanYuYuan commented Mar 31, 2026

Summary

test_action_communication, test_action_interaction, and test_graph in rcl_action all spawn two nodes in separate processes that must discover each other. These tests were using ZENOH_CONFIG_OVERRIDE=scouting/multicast/enabled=true as a workaround for Zenoh's default non-multicast config, but multicast is unreliable in CI environments and unavailable on Windows, causing test_graph__rmw_zenoh_cpp to fail with rcl_action_get_server_names_and_types_by_node returning RCL_RET_ERROR.

Key Changes

  • Replace ament_add_gtest_test + ZENOH_CONFIG_OVERRIDE=scouting/multicast/enabled=true with ament_add_ros_isolated_gtest_test for all three cross-node tests
  • ament_add_ros_isolated_gtest_test wraps the test with run_test_isolated.py, which calls rmw_test_isolation_start() to start an in-process router and configure all processes to connect to it — no multicast required
  • This is the same mechanism already used by rcl/test/CMakeLists.txt for its own test_graph and other cross-node tests

Deep Dive

rmw_test_isolation_start() (source) starts an in-process Zenoh router on a random port and writes ZENOH_CONFIG_OVERRIDE=connect/endpoints=[tcp/127.0.0.1:<port>] into the environment (line 136–139). All processes that inherit the environment connect to this router and share the same discovery graph, making multicast unnecessary.

Breaking Changes

None

Closes ros2/rmw_zenoh#932

test_action_communication, test_action_interaction, and test_graph all
spawn two nodes in separate processes that must discover each other.
These tests were using ZENOH_CONFIG_OVERRIDE=scouting/multicast/enabled=true
as a workaround, but multicast is unreliable in CI environments (and
unavailable on Windows), causing intermittent failures.

Replace the multicast workaround with ament_add_ros_isolated_gtest_test,
which wraps the test with run_test_isolated.py and rmw_test_isolation_start()
to start an in-process router and configure all subprocesses to connect to it.
This is the same mechanism already used by rcl/test/CMakeLists.txt for its
own test_graph and other cross-node tests.

Signed-off-by: yuanyuyuan <az6980522@gmail.com>
@YuanYuYuan YuanYuYuan force-pushed the fix/action-graph-isolation branch from f0eb7db to 3eb1762 Compare March 31, 2026 09:41
@fujitatomoya
Copy link
Copy Markdown
Collaborator

Pulls: #1311
Gist: https://gist.githubusercontent.com/fujitatomoya/58fdc061902fe4555943c33651846294/raw/f2702c4fe5667ab7096cf517d2b34198dfb18c19/ros2.repos
BUILD args: --packages-up-to rcl_action
TEST args: --packages-select rcl_action
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18758

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

Copy link
Copy Markdown
Member

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

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

Thanks!

@ahcorde ahcorde merged commit 4d8f22a into ros2:rolling Apr 1, 2026
3 of 4 checks passed
@cottsay
Copy link
Copy Markdown
Member

cottsay commented Apr 13, 2026

@Mergifyio backport kilted

@mergify
Copy link
Copy Markdown

mergify Bot commented Apr 13, 2026

backport kilted

✅ Backports have been created

Details

mergify Bot pushed a commit that referenced this pull request Apr 13, 2026
test_action_communication, test_action_interaction, and test_graph all
spawn two nodes in separate processes that must discover each other.
These tests were using ZENOH_CONFIG_OVERRIDE=scouting/multicast/enabled=true
as a workaround, but multicast is unreliable in CI environments (and
unavailable on Windows), causing intermittent failures.

Replace the multicast workaround with ament_add_ros_isolated_gtest_test,
which wraps the test with run_test_isolated.py and rmw_test_isolation_start()
to start an in-process router and configure all subprocesses to connect to it.
This is the same mechanism already used by rcl/test/CMakeLists.txt for its
own test_graph and other cross-node tests.

Signed-off-by: yuanyuyuan <az6980522@gmail.com>
(cherry picked from commit 4d8f22a)
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.

🧑‍🌾 ros2cli tests failing in rolling zenoh because zennoh router isn't working

5 participants