From 8cd43244f2774c878ea4f8ddd3fe83d67917dd2b Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Wed, 13 Jan 2021 18:41:22 +0100 Subject: [PATCH] Call rclcpp::shutdown in test_node for clean shutdown on Windows The graph_listener thread is started in the background in some of the tests and this thread is killed by Windows prior to executing global destructors if it is still running when leaving main(). This then corrupts state because the RMW layer is blocking in a waitset and causes Cyclone to hang trying to destroy the waitset. Signed-off-by: Erik Boasson --- rclcpp/test/rclcpp/test_node.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rclcpp/test/rclcpp/test_node.cpp b/rclcpp/test/rclcpp/test_node.cpp index 8e9764d9f2..8e7b19c30d 100644 --- a/rclcpp/test/rclcpp/test_node.cpp +++ b/rclcpp/test/rclcpp/test_node.cpp @@ -43,6 +43,11 @@ class TestNode : public ::testing::Test rclcpp::init(0, nullptr); } + static void TearDownTestCase() + { + rclcpp::shutdown(); + } + void SetUp() override { test_resources_path /= "test_node";