Skip to content

Proper cleanup in asymmetric_inflation_tests - #6487

Merged
nirwester merged 1 commit into
ros-navigation:mainfrom
botsandus:fix-hanging-test-with-zenoh
Sep 13, 2026
Merged

nirwester merged 1 commit into
ros-navigation:mainfrom
botsandus:fix-hanging-test-with-zenoh

Conversation

@tonynajjar

Copy link
Copy Markdown
Contributor

Basic Info

Info Please fill out this column
Ticket(s) this addresses (add tickets here #1)
Primary OS tested on (Ubuntu, MacOS, Windows)
Robotic platform tested on (Steve's Robot, gazebo simulation of Tally, hardware turtlebot)
Does this PR contain AI generated software? (No; Yes and it is marked inline in the code)
Was this PR description generated by AI software? Out of respect for maintainers, AI for human-to-human communications are banned

Description of contribution in a few bullet points

Without this fix it hangs for me with Zenoh

[       OK ] AsymmetricInflationIntegrationTest.update_parameters_callback_filters_base_cost_scaling (1 ms)
[----------] 24 tests from AsymmetricInflationIntegrationTest (37 ms total)

[----------] Global test environment tear-down
[==========] 31 tests from 2 test suites ran. (50 ms total)
[  PASSED  ] 31 tests.

thread '<unnamed>' (814155) panicked at /root/.cargo/git/checkouts/zenoh-960d3fab753191f7/8e2bdda/commons/zenoh-runtime/src/lib.rs:154:21:
The Thread Local Storage inside Tokio is destroyed. This might happen when Zenoh API is called at process exit, e.g. in the atexit handler. Calling the Zenoh API at process exit is not supported and should be avoided.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Stack trace (most recent call last):
#25   Object "/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2", at 0xffffffffffffffff, in 

Description of documentation updates required from your changes

Description of how this change was tested


Future work that may be required in bullet points

For Maintainers:

  • Check that any new parameters added are updated in docs.nav2.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists
  • Should this be backported to current distributions? If so, tag with backport-*.

@nirwester nirwester left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Makes sense to me

@codecov

codecov Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nirwester
nirwester merged commit f31c7f4 into ros-navigation:main Sep 13, 2026
19 checks passed
SteveMacenski pushed a commit that referenced this pull request Sep 14, 2026
…ource cleanup (#6487) (#6508)

(cherry picked from commit f31c7f4)

Signed-off-by: Tony Najjar <[email protected]>
Co-authored-by: Tony Najjar <[email protected]>
mbloechli pushed a commit to Duatic/navigation2 that referenced this pull request Oct 23, 2026
Backport of ros-navigation#6487. The integration tests initialised and shut down rclcpp
from a global fixture, which ran at process exit and hung under Zenoh.
main() now owns rclcpp::init and rclcpp::shutdown, and the fixture's
TearDown releases the layer, costmap, TF buffer and node first.

Resolved against Jazzy's nav2_util::LifecycleNode and tf2_ros::Buffer
members.

(cherry picked from commit f31c7f4)
Signed-off-by: mbloechli <[email protected]>
mbloechli pushed a commit to Duatic/navigation2 that referenced this pull request Oct 23, 2026
Backport of ros-navigation#6487. The integration tests initialised and shut down rclcpp
from a global fixture, which ran at process exit and hung under Zenoh.
main() now owns rclcpp::init and rclcpp::shutdown, and the fixture's
TearDown releases the layer, costmap, TF buffer and node first.

Resolved against Kilted's nav2_util::LifecycleNode and tf2_ros::Buffer
members.

(cherry picked from commit f31c7f4)
Signed-off-by: mbloechli <[email protected]>
SteveMacenski pushed a commit that referenced this pull request Oct 27, 2026
…-aware lane-keeping (backport #6118 & #6487) (#6688)

* feat(nav2_costmap_2d): backport AsymmetricInflationLayer to Jazzy

Backport of #6118. Upstream builds the layer on the distance transform
InflationLayer from #5933, which Jazzy does not have, so the layer is
ported onto Jazzy's InflationLayer instead:

* Pass 1 uses Jazzy's InflationLayer::updateCosts for the symmetric
  baseline. Pass 2 matches upstream and uses distance_transform.hpp, taken
  unchanged from #5933. Nothing else from #5933 is backported, so
  Jazzy's InflationLayer keeps its implementation and class layout.
* Parameters are declared with Layer::declareParameter, and a single
  on-set callback validates and applies them, as in Jazzy's other layers.
* num_threads and the OpenMP loop are dropped, since Jazzy builds the
  layers without OpenMP.
* plan_topic is resolved in the costmap's parent namespace inside the
  layer, because Jazzy's Layer has no joinWithParentNamespace.
* Includes the null check on the first path message from #6281.
* The benchmark is dropped, as Jazzy has no costmap benchmark suite.

The tests follow the same changes: nav2_util::LifecycleNode, no
activate, deactivate or num_threads cases, and a new case for rejecting
negative parameters.

(cherry picked from commit 6a8161e)
Signed-off-by: mbloechli <[email protected]>

* test(nav2_costmap_2d): clean up rclcpp in asymmetric inflation tests

Backport of #6487. The integration tests initialised and shut down rclcpp
from a global fixture, which ran at process exit and hung under Zenoh.
main() now owns rclcpp::init and rclcpp::shutdown, and the fixture's
TearDown releases the layer, costmap, TF buffer and node first.

Resolved against Jazzy's nav2_util::LifecycleNode and tf2_ros::Buffer
members.

(cherry picked from commit f31c7f4)
Signed-off-by: mbloechli <[email protected]>

---------

Signed-off-by: mbloechli <[email protected]>
Co-authored-by: Tony Najjar <[email protected]>
SteveMacenski pushed a commit that referenced this pull request Oct 27, 2026
…-aware lane-keeping (backport #6118 & #6487) (#6689)

* feat(nav2_costmap_2d): backport AsymmetricInflationLayer to Kilted

Backport of #6118. Upstream builds the layer on the distance transform
InflationLayer from #5933, which Kilted does not have, so the layer is
ported onto Kilted's InflationLayer instead, as in the Jazzy backport:

* Pass 1 uses Kilted's InflationLayer::updateCosts for the symmetric
  baseline. Pass 2 matches upstream and uses distance_transform.hpp, taken
  unchanged from #5933. Nothing else from #5933 is backported, so
  Kilted's InflationLayer keeps its implementation and class layout.
* distance_transform.hpp needs Eigen, so Eigen3 is added as a dependency
  of the layers library and exported, as #5933 does upstream.
* Parameters are declared with Layer::declareParameter, and a single
  on-set callback validates and applies them, as in Kilted's other layers.
* num_threads and the OpenMP loop are dropped, since Kilted builds the
  layers without OpenMP.
* Includes the null check on the first path message from #6281.
* The benchmark is dropped, as Kilted has no costmap benchmark suite.

The tests follow the same changes: nav2_util::LifecycleNode, no
activate, deactivate or num_threads cases, a new case for rejecting
negative parameters and one for resolving plan_topic.

(cherry picked from commit 6a8161e)
Signed-off-by: mbloechli <[email protected]>

* test(nav2_costmap_2d): clean up rclcpp in asymmetric inflation tests

Backport of #6487. The integration tests initialised and shut down rclcpp
from a global fixture, which ran at process exit and hung under Zenoh.
main() now owns rclcpp::init and rclcpp::shutdown, and the fixture's
TearDown releases the layer, costmap, TF buffer and node first.

Resolved against Kilted's nav2_util::LifecycleNode and tf2_ros::Buffer
members.

(cherry picked from commit f31c7f4)
Signed-off-by: mbloechli <[email protected]>

---------

Signed-off-by: mbloechli <[email protected]>
Co-authored-by: Tony Najjar <[email protected]>
Rooteq pushed a commit to Rooteq/navigation2 that referenced this pull request Nov 9, 2026
…-aware lane-keeping (backport ros-navigation#6118 & ros-navigation#6487) (ros-navigation#6688)

* feat(nav2_costmap_2d): backport AsymmetricInflationLayer to Jazzy

Backport of ros-navigation#6118. Upstream builds the layer on the distance transform
InflationLayer from ros-navigation#5933, which Jazzy does not have, so the layer is
ported onto Jazzy's InflationLayer instead:

* Pass 1 uses Jazzy's InflationLayer::updateCosts for the symmetric
  baseline. Pass 2 matches upstream and uses distance_transform.hpp, taken
  unchanged from ros-navigation#5933. Nothing else from ros-navigation#5933 is backported, so
  Jazzy's InflationLayer keeps its implementation and class layout.
* Parameters are declared with Layer::declareParameter, and a single
  on-set callback validates and applies them, as in Jazzy's other layers.
* num_threads and the OpenMP loop are dropped, since Jazzy builds the
  layers without OpenMP.
* plan_topic is resolved in the costmap's parent namespace inside the
  layer, because Jazzy's Layer has no joinWithParentNamespace.
* Includes the null check on the first path message from ros-navigation#6281.
* The benchmark is dropped, as Jazzy has no costmap benchmark suite.

The tests follow the same changes: nav2_util::LifecycleNode, no
activate, deactivate or num_threads cases, and a new case for rejecting
negative parameters.

(cherry picked from commit 6a8161e)
Signed-off-by: mbloechli <[email protected]>

* test(nav2_costmap_2d): clean up rclcpp in asymmetric inflation tests

Backport of ros-navigation#6487. The integration tests initialised and shut down rclcpp
from a global fixture, which ran at process exit and hung under Zenoh.
main() now owns rclcpp::init and rclcpp::shutdown, and the fixture's
TearDown releases the layer, costmap, TF buffer and node first.

Resolved against Jazzy's nav2_util::LifecycleNode and tf2_ros::Buffer
members.

(cherry picked from commit f31c7f4)
Signed-off-by: mbloechli <[email protected]>

---------

Signed-off-by: mbloechli <[email protected]>
Co-authored-by: Tony Najjar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants