Skip to content

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

Open
mergify[bot] wants to merge 1 commit into
kiltedfrom
mergify/bp/kilted/pr-1311
Open

fix(rcl_action): use RMW isolation for cross-node tests (backport #1311)#1316
mergify[bot] wants to merge 1 commit into
kiltedfrom
mergify/bp/kilted/pr-1311

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented Apr 13, 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


This is an automatic backport of pull request #1311 done by [Mergify](https://mergify.com).

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.

1 participant