Skip to content
Snippets Groups Projects
Commit 6bf26d36 authored by Kenny Sharma's avatar Kenny Sharma
Browse files

[NRRPLT-4885] Cleanup ROS nodes created by distributed launch.

The distributed launch now creates a ROS node in the CLE to ensure
logs are properly redirected to stdout. This node and any future nodes
should be cleaned up as we do in the CLELauncher, but this needs to be
done after shutdown of all launched components.

Change-Id: I00733872978d13cf4c3f319c7e594feae866d930
parent e42c1245
No related branches found
No related tags found
No related merge requests found
......@@ -133,3 +133,6 @@ class MUSICLauncher(object):
if self._launcher:
self._launcher.shutdown()
self._launcher = None
# finally, cleanup the roscore and any registrations launched by the above
os.system("echo 'y' | timeout -s SIGKILL 10s rosnode cleanup >/dev/null 2>&1")
......@@ -47,7 +47,8 @@ class TestMUSICLauncher(unittest.TestCase):
self.__launcher.cle_server.build.assert_called_once()
self.__launcher.cle_server.launch.assert_called_once()
def test_shutdown(self):
@patch('os.system')
def test_shutdown(self, system_mock):
# mock the cleserver and launcher
mock_cle_server = Mock()
......@@ -68,5 +69,8 @@ class TestMUSICLauncher(unittest.TestCase):
self.assertEqual(self.__launcher.cle_server, None)
self.assertEqual(self.__launcher._launcher, None)
# verify the ros cleanup command has been called
system_mock.assert_called_once()
if __name__ == "__main__":
unittest.main()
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment