diff --git a/pendulum_control/test/test_pendulum_demo.py.in b/pendulum_control/test/test_pendulum_demo.py.in index 06e695a53..cdc0a1a8c 100644 --- a/pendulum_control/test/test_pendulum_demo.py.in +++ b/pendulum_control/test/test_pendulum_demo.py.in @@ -9,6 +9,7 @@ from launch.launcher import DefaultLauncher from launch.output_handler import ConsoleOutput from launch_testing import create_handler +from launch_testing import get_default_filtered_prefixes def setup(): @@ -23,7 +24,7 @@ def test_executable(): rmw_implementation = '@rmw_implementation@' pendulum_logger_executable = '@RCLCPP_DEMO_PENDULUM_LOGGER_EXECUTABLE@' pendulum_logger_output_file = '@RCLCPP_DEMO_PENDULUM_LOGGER_EXPECTED_OUTPUT@' - pendulum_logger_name = 'test_executable_0' + pendulum_logger_name = 'pendulum_logger' pendulum_logger_handler = create_handler(pendulum_logger_name, launch_descriptor, pendulum_logger_output_file) assert pendulum_logger_handler, 'Cannot find appropriate handler for %s' % pendulum_logger_output_file output_handlers.append(pendulum_logger_handler) @@ -36,9 +37,19 @@ def test_executable(): pendulum_demo_executable = '@RCLCPP_DEMO_PENDULUM_DEMO_EXECUTABLE@' pendulum_demo_output_file = '@RCLCPP_DEMO_PENDULUM_DEMO_EXPECTED_OUTPUT@' - pendulum_demo_name = 'test_executable_1' + pendulum_demo_name = 'pendulum_demo' + + filtered_prefixes = get_default_filtered_prefixes() + if rmw_implementation.startswith('rmw_connext'): + # This output can be caused by a small QoS depth leading to samples being discarded. + # Since we are optimizing for performance with a depth of 1, we can ignore it. + filtered_prefixes.append( + b'PRESWriterHistoryDriver_completeBeAsynchPub:!make_sample_reclaimable' + ) + pendulum_demo_handler = create_handler( pendulum_demo_name, launch_descriptor, pendulum_demo_output_file, + filtered_prefixes=filtered_prefixes, filtered_rmw_implementation=rmw_implementation) assert pendulum_demo_handler, 'Cannot find appropriate handler for %s' % pendulum_demo_output_file output_handlers.append(pendulum_demo_handler) diff --git a/pendulum_control/test/test_pendulum_teleop.py.in b/pendulum_control/test/test_pendulum_teleop.py.in index 010debb48..3d329fcc3 100644 --- a/pendulum_control/test/test_pendulum_teleop.py.in +++ b/pendulum_control/test/test_pendulum_teleop.py.in @@ -10,6 +10,7 @@ from launch.launcher import DefaultLauncher from launch.output_handler import ConsoleOutput from launch_testing import create_handler +from launch_testing import get_default_filtered_prefixes def setup(): @@ -24,7 +25,7 @@ def test_executable(): rmw_implementation = '@rmw_implementation@' pendulum_demo_executable = '@RCLCPP_DEMO_PENDULUM_DEMO_EXECUTABLE@' pendulum_demo_output_file = '@RCLCPP_DEMO_PENDULUM_DEMO_TELEOP_EXPECTED_OUTPUT@' - pendulum_demo_name = 'test_executable_0' + pendulum_demo_name = 'pendulum_demo' pendulum_demo_handler = create_handler(pendulum_demo_name, launch_descriptor, pendulum_demo_output_file) assert pendulum_demo_handler, 'Cannot find appropriate handler for %s' % pendulum_demo_output_file output_handlers.append(pendulum_demo_handler) @@ -37,9 +38,19 @@ def test_executable(): pendulum_teleop_executable = '@RCLCPP_DEMO_PENDULUM_TELEOP_EXECUTABLE@' pendulum_teleop_output_file = '@RCLCPP_DEMO_PENDULUM_TELEOP_EXPECTED_OUTPUT@' - pendulum_teleop_name = 'test_executable_1' + pendulum_teleop_name = 'pendulum_teleop' + + filtered_prefixes = get_default_filtered_prefixes() + if rmw_implementation.startswith('rmw_connext'): + # This output can be caused by a small QoS depth leading to samples being discarded. + # Since we are optimizing for performance with a depth of 1, we can ignore it. + filtered_prefixes.append( + b'PRESWriterHistoryDriver_completeBeAsynchPub:!make_sample_reclaimable' + ) + pendulum_teleop_handler = create_handler( pendulum_teleop_name, launch_descriptor, pendulum_teleop_output_file, + filtered_prefixes=filtered_prefixes, filtered_rmw_implementation=rmw_implementation) assert pendulum_teleop_handler, 'Cannot find appropriate handler for %s' % pendulum_teleop_output_file output_handlers.append(pendulum_teleop_handler)