fix(test_events_executor): destroy all nodes before shutdown (backport #1538)#1539
Merged
fujitatomoya merged 1 commit intokiltedfrom Nov 8, 2025
Merged
fix(test_events_executor): destroy all nodes before shutdown (backport #1538)#1539fujitatomoya merged 1 commit intokiltedfrom
fujitatomoya merged 1 commit intokiltedfrom
Conversation
Signed-off-by: yuanyuyuan <az6980522@gmail.com> (cherry picked from commit 162021a)
Contributor
|
Pulls: #1539 |
ahcorde
approved these changes
Nov 7, 2025
fujitatomoya
approved these changes
Nov 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This closes ros2/rmw_zenoh#852. rmw_zenoh failed to pass the test since the publisher declared in
test_async_subwas accidentally detected by the subsequenttest_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.shutdowndoes 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
This is an automatic backport of pull request fix(test_events_executor): destroy all nodes before shutdown #1538 done by Mergify.