diff --git a/demo_nodes_cpp/CMakeLists.txt b/demo_nodes_cpp/CMakeLists.txt index 54f782c6b..bbaeb99f6 100644 --- a/demo_nodes_cpp/CMakeLists.txt +++ b/demo_nodes_cpp/CMakeLists.txt @@ -107,7 +107,7 @@ if(BUILD_TESTING) add_launch_test( "${CMAKE_CURRENT_BINARY_DIR}/test_${exe_list_underscore}${target_suffix}_$.py" TARGET test_tutorial_${exe_list_underscore}${target_suffix} - TIMEOUT 30 + TIMEOUT 60 ENV RCL_ASSERT_RMW_ID_MATCHES=${rmw_implementation} RMW_IMPLEMENTATION=${rmw_implementation} diff --git a/demo_nodes_cpp/test/test_executables_tutorial.py.in b/demo_nodes_cpp/test/test_executables_tutorial.py.in index d792fe695..7285be0c3 100644 --- a/demo_nodes_cpp/test/test_executables_tutorial.py.in +++ b/demo_nodes_cpp/test/test_executables_tutorial.py.in @@ -11,7 +11,7 @@ from launch.actions import OpaqueFunction import launch_testing import launch_testing.asserts -import launch_testing.utils +import launch_testing.util import launch_testing_ros @@ -27,7 +27,7 @@ def generate_test_description(ready_fn): ] for process in processes_under_test: launch_description.add_action(process) - launch_description.add_action(launch_testing.utils.KeepAliveProc()) + launch_description.add_action(launch_testing.util.KeepAliveProc()) launch_description.add_action( OpaqueFunction(function=lambda context: ready_fn()) ) @@ -50,24 +50,19 @@ class TestExecutablesTutorial(unittest.TestCase): proc_output.assertWaitFor( expected_output=launch_testing.tools.expected_output_from_file( path=output_file - ), process=process, output_filter=output_filter, timeout=10 + ), process=process, output_filter=output_filter, timeout=30 ) - + # TODO(hidmic): either make the underlying executables resilient to + # interruptions close/during shutdown OR adapt the testing suite to + # better cope with it. + import time + time.sleep(5) @launch_testing.post_shutdown_test() class TestExecutablesTutorialAfterShutdown(unittest.TestCase): def test_last_process_exit_code(self, proc_info, processes_under_test): """Test last process exit code.""" - # TODO(hidmic): fail the test on a nonzero exit code. - # Currently pre shutdown tests are terminating too soon and - # the signal seems to be sent in the middle of the fixture - # nodes' shutdown (for those that shutdown themselves) and - # these are not handling this situation gracefully. If pre - # shutdown test termination is delayed instead, the testing - # framework complains about the launch run terminating before - # tests are done. - launch_testing.asserts.assertExitCodes( proc_info, process=processes_under_test[-1]