Skip to content

Commit 263a2ce

Browse files
Wait to terminate test until spawner exits (#3373)
1 parent 09203a1 commit 263a2ce

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

controller_manager/test/test_ros2_control_node_launch.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,17 @@ def tearDown(self):
105105
def test_node_start(self):
106106
check_node_running(self.node, "controller_manager")
107107

108-
def test_controllers_start(self):
108+
def test_controllers_start(self, proc_info):
109109
cnames = ["ctrl_with_parameters_and_type"]
110-
check_controllers_running(self.node, cnames, state="active")
110+
111+
check_controllers_running(self.node, cnames)
112+
113+
# Wait for controller_spawner to finish and verify successful exit.
114+
proc_info.assertWaitForShutdown(process="spawner", timeout=30)
115+
launch_testing.asserts.assertExitCodes(proc_info, process="spawner")
116+
117+
# Re-check controllers after spawner has exited.
118+
check_controllers_running(self.node, cnames)
111119

112120

113121
@launch_testing.post_shutdown_test()

0 commit comments

Comments
 (0)