Skip to content

Commit

Permalink
Call rclcpp::shutdown in test_node for clean shutdown on Windows (#1515)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
eboasson authored Jan 13, 2021
1 parent 56a037a commit 8d2c682
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rclcpp/test/rclcpp/test_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 8d2c682

Please sign in to comment.