Skip to content

Commit 8d2c682

Browse files
authored
Call rclcpp::shutdown in test_node for clean shutdown on Windows (ros2#1515)
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 <[email protected]>
1 parent 56a037a commit 8d2c682

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rclcpp/test/rclcpp/test_node.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ class TestNode : public ::testing::Test
4343
rclcpp::init(0, nullptr);
4444
}
4545

46+
static void TearDownTestCase()
47+
{
48+
rclcpp::shutdown();
49+
}
50+
4651
void SetUp() override
4752
{
4853
test_resources_path /= "test_node";

0 commit comments

Comments
 (0)