Skip to content

fix(test_events_executor): destroy all nodes before shutdown (backport #1538)#1539

Merged
fujitatomoya merged 1 commit intokiltedfrom
mergify/bp/kilted/pr-1538
Nov 8, 2025
Merged

fix(test_events_executor): destroy all nodes before shutdown (backport #1538)#1539
fujitatomoya merged 1 commit intokiltedfrom
mergify/bp/kilted/pr-1538

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Nov 7, 2025

Description

This closes ros2/rmw_zenoh#852. rmw_zenoh failed to pass the test since the publisher declared in test_async_sub was accidentally detected by the subsequent test_pub_sub (the tests run in alphabetical order). The root cause is that the publisher node is not explicitly destroyed during the rclpy shutdown.

To clarify, this behavior stems from the different mechanism used in rmw_zenoh compared to other DDS implementations. Specifically, the shutdown of rmw_zenoh doesn't immediately close the Zenoh session as long as other nodes are still alive. This aligns with the RMW philosophy that nodes and their associated entities such as publishers, subscriptions, and so on, are not explicitly destroyed by rmw_shutdown.

Introduing a sleep after rclpy.shutdown does not solve the issue because the node data remain referenced until the object destruction phase. Meanwhile, the next test begins immediately and reads the stale liveliness token, causing the test to fail.

This fix adotps the approach used in other tests by explicitly cleaning up the nodes to avoid such stale references.

Is this user-facing behavior change?

Did you use Generative AI?

Additional Information

Signed-off-by: yuanyuyuan <az6980522@gmail.com>
(cherry picked from commit 162021a)
@ahcorde
Copy link
Copy Markdown
Contributor

ahcorde commented Nov 7, 2025

Pulls: #1539
Gist: https://gist.githubusercontent.com/ahcorde/4701a44572c090616220ba90b23c5ea3/raw/eb81a04ab84b38338855776ec5edc563241924b9/ros2.repos
BUILD args: --packages-above-and-dependencies rclpy
TEST args: --packages-above rclpy
ROS Distro: kilted
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/17418

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

@fujitatomoya fujitatomoya merged commit 36ce33a into kilted Nov 8, 2025
2 of 3 checks passed
@ahcorde ahcorde deleted the mergify/bp/kilted/pr-1538 branch November 10, 2025 07:56
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