Skip to content

Commit

Permalink
Ignore a connext output caused by small depth in pendulum_control tes…
Browse files Browse the repository at this point in the history
…ts (#156)
  • Loading branch information
dhood authored Aug 5, 2017
1 parent e4ce07b commit ac67079
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
15 changes: 13 additions & 2 deletions pendulum_control/test/test_pendulum_demo.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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)
Expand All @@ -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)
Expand Down
15 changes: 13 additions & 2 deletions pendulum_control/test/test_pendulum_teleop.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit ac67079

Please sign in to comment.