diff --git a/rcl/test/rcl/service_fixture.cpp b/rcl/test/rcl/service_fixture.cpp index 665b800..9554f5a 100644 --- a/rcl/test/rcl/service_fixture.cpp +++ b/rcl/test/rcl/service_fixture.cpp @@ -113,8 +113,6 @@ int main(int argc, char ** argv) } }); - std::this_thread::sleep_for(std::chrono::milliseconds(1000)); - // Initialize a response. example_interfaces__srv__AddTwoInts_Response service_response; example_interfaces__srv__AddTwoInts_Response__init(&service_response); @@ -149,6 +147,10 @@ int main(int argc, char ** argv) return -1; } // Our scope exits should take care of fini for everything + // stick around until launch gives us a signal to exit + while (true) { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } } return main_ret; } diff --git a/rcl/test/rcl/test_two_executables.py.in b/rcl/test/rcl/test_two_executables.py.in index 1e4bf86..f9197e0 100644 --- a/rcl/test/rcl/test_two_executables.py.in +++ b/rcl/test/rcl/test_two_executables.py.in @@ -1,6 +1,7 @@ # generated from rcl/test/test_two_executables.py.in from launch import LaunchDescriptor +from launch.exit_handler import ignore_signal_exit_handler from launch.exit_handler import primary_exit_handler from launch.launcher import DefaultLauncher @@ -11,11 +12,13 @@ def @TEST_NAME@(): ld.add_process( cmd=['@TEST_EXECUTABLE1@'], name='@TEST_EXECUTABLE1_NAME@', + exit_handler=ignore_signal_exit_handler, ) ld.add_process( cmd=['@TEST_EXECUTABLE2@', '@TEST_EXECUTABLE1_NAME@'], name='@TEST_EXECUTABLE2_NAME@', + exit_handler=primary_exit_handler, ) launcher = DefaultLauncher()