Skip to content

fix(test_cli_remapping): use EnableRmwIsolation for zenoh router (backport #588)#590

Open
mergify[bot] wants to merge 1 commit intokiltedfrom
mergify/bp/kilted/pr-588
Open

fix(test_cli_remapping): use EnableRmwIsolation for zenoh router (backport #588)#590
mergify[bot] wants to merge 1 commit intokiltedfrom
mergify/bp/kilted/pr-588

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify bot commented Apr 13, 2026

Summary

test_cli_remapping fails in the Rci__nightly-zenoh_ubuntu_noble_amd64 CI because its nodes cannot discover each other — the test uses add_launch_test without RMW isolation, so there is no shared network for cross-process node discovery.

Key Changes

  • Add EnableRmwIsolation() as the first launch action so the isolated network is set up before any subprocesses are spawned
  • Replace env=dict(os.environ) (snapshot taken before isolation runs) with additional_env={'PYTHONUNBUFFERED': '1'} so each subprocess inherits the live environment at spawn time and joins the isolated network
  • Add launch_testing_ros and rmw_test_fixture_implementation as test dependencies in package.xml

Breaking Changes

None

Deep Dive

EnableRmwIsolation calls rmw_test_isolation_start(), which starts an in-process Zenoh router on a random port and then sets ZENOH_CONFIG_OVERRIDE=connect/endpoints=[tcp/127.0.0.1:<port>] in the current process environment (line 136–139). Any subprocess that inherits os.environ will have rmw_zenoh_cpp connect to that router and share the same discovery graph.

The original code does env=dict(os.environ) before the launch description executes, so the snapshot is taken before EnableRmwIsolation.execute() runs and ZENOH_CONFIG_OVERRIDE is not yet set. The subprocesses receive a frozen copy of the environment that predates isolation and therefore never connect to the in-process router. Replacing it with additional_env causes the subprocess to inherit the live os.environ at the time it is actually spawned, after isolation has started.

Closes ros2/rmw_zenoh#932


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

test_cli_remapping uses add_launch_test without rmw isolation, so the
test executables have no router to connect to when using rmw_zenoh_cpp.

Add EnableRmwIsolation() as the first launch action so an in-process
router is started before any nodes.  Remove the os.environ snapshot
(env=dict(os.environ)) and replace it with additional_env so that the
ZENOH_CONFIG_OVERRIDE set by isolation is inherited by the processes.

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