From 47b08b4b3e62eecf02af3037c7ab265f01a33cd0 Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Tue, 12 Jan 2021 18:59:09 -0300 Subject: [PATCH 1/6] Revert "Skip CLI tests on Windows until we resolve the blocking/hanging isuse. (#489)" This reverts commit 8ad1208bd828c9b24a1c5a4d4b9d1b82d0d89d42. Signed-off-by: Michel Hidalgo --- ros2action/test/test_cli.py | 8 -------- ros2interface/test/test_cli.py | 9 --------- ros2lifecycle/test/test_cli.py | 9 --------- ros2node/test/test_cli.py | 8 -------- ros2node/test/test_cli_duplicate_node_names.py | 8 -------- ros2pkg/test/test_cli.py | 9 --------- ros2service/test/test_cli.py | 8 -------- ros2topic/test/test_cli.py | 8 -------- ros2topic/test/test_echo_pub.py | 9 --------- 9 files changed, 76 deletions(-) diff --git a/ros2action/test/test_cli.py b/ros2action/test/test_cli.py index 2d6c8d8c0..aeb352f77 100644 --- a/ros2action/test/test_cli.py +++ b/ros2action/test/test_cli.py @@ -35,14 +35,6 @@ import yaml -# Skip cli tests on Windows while they exhibit pathological behavior -# https://github.com/ros2/build_farmer/issues/248 -if sys.platform.startswith('win'): - pytest.skip( - 'CLI tests can block for a pathological amount of time on Windows.', - allow_module_level=True) - - @pytest.mark.rostest @launch_testing.parametrize('rmw_implementation', get_available_rmw_implementations()) def generate_test_description(rmw_implementation): diff --git a/ros2interface/test/test_cli.py b/ros2interface/test/test_cli.py index 8f1c91c5b..211ce89c5 100644 --- a/ros2interface/test/test_cli.py +++ b/ros2interface/test/test_cli.py @@ -15,7 +15,6 @@ import contextlib import itertools import re -import sys import unittest from launch import LaunchDescription @@ -30,14 +29,6 @@ import pytest -# Skip cli tests on Windows while they exhibit pathological behavior -# https://github.com/ros2/build_farmer/issues/248 -if sys.platform.startswith('win'): - pytest.skip( - 'CLI tests can block for a pathological amount of time on Windows.', - allow_module_level=True) - - some_messages_from_test_msgs = [ 'test_msgs/msg/BasicTypes', 'test_msgs/msg/Constants', diff --git a/ros2lifecycle/test/test_cli.py b/ros2lifecycle/test/test_cli.py index c99c35f9b..bf5f55a8e 100644 --- a/ros2lifecycle/test/test_cli.py +++ b/ros2lifecycle/test/test_cli.py @@ -13,7 +13,6 @@ # limitations under the License. import contextlib -import sys import unittest from launch import LaunchDescription @@ -32,14 +31,6 @@ from rclpy.utilities import get_available_rmw_implementations -# Skip cli tests on Windows while they exhibit pathological behavior -# https://github.com/ros2/build_farmer/issues/248 -if sys.platform.startswith('win'): - pytest.skip( - 'CLI tests can block for a pathological amount of time on Windows.', - allow_module_level=True) - - ALL_LIFECYCLE_NODE_TRANSITIONS = [ '- configure [1]', '\tStart: unconfigured', diff --git a/ros2node/test/test_cli.py b/ros2node/test/test_cli.py index 97f02ff4f..90daedd4c 100644 --- a/ros2node/test/test_cli.py +++ b/ros2node/test/test_cli.py @@ -36,14 +36,6 @@ from rclpy.utilities import get_available_rmw_implementations -# Skip cli tests on Windows while they exhibit pathological behavior -# https://github.com/ros2/build_farmer/issues/248 -if sys.platform.startswith('win'): - pytest.skip( - 'CLI tests can block for a pathological amount of time on Windows.', - allow_module_level=True) - - @pytest.mark.rostest @launch_testing.parametrize('rmw_implementation', get_available_rmw_implementations()) def generate_test_description(rmw_implementation): diff --git a/ros2node/test/test_cli_duplicate_node_names.py b/ros2node/test/test_cli_duplicate_node_names.py index 3a48cd350..540a7edb9 100644 --- a/ros2node/test/test_cli_duplicate_node_names.py +++ b/ros2node/test/test_cli_duplicate_node_names.py @@ -35,14 +35,6 @@ from ros2node.api import INFO_NONUNIQUE_WARNING_TEMPLATE -# Skip cli tests on Windows while they exhibit pathological behavior -# https://github.com/ros2/build_farmer/issues/248 -if sys.platform.startswith('win'): - pytest.skip( - 'CLI tests can block for a pathological amount of time on Windows.', - allow_module_level=True) - - @pytest.mark.rostest @launch_testing.parametrize('rmw_implementation', get_available_rmw_implementations()) def generate_test_description(rmw_implementation): diff --git a/ros2pkg/test/test_cli.py b/ros2pkg/test/test_cli.py index 244623174..8d4811ee6 100644 --- a/ros2pkg/test/test_cli.py +++ b/ros2pkg/test/test_cli.py @@ -14,7 +14,6 @@ import contextlib import os -import sys import tempfile import unittest import xml.etree.ElementTree as ET @@ -31,14 +30,6 @@ import pytest -# Skip cli tests on Windows while they exhibit pathological behavior -# https://github.com/ros2/build_farmer/issues/248 -if sys.platform.startswith('win'): - pytest.skip( - 'CLI tests can block for a pathological amount of time on Windows.', - allow_module_level=True) - - some_cli_packages = [ 'ros2cli', 'ros2pkg' diff --git a/ros2service/test/test_cli.py b/ros2service/test/test_cli.py index cb9cb8a8e..371a805b7 100644 --- a/ros2service/test/test_cli.py +++ b/ros2service/test/test_cli.py @@ -38,14 +38,6 @@ from test_msgs.srv import BasicTypes -# Skip cli tests on Windows while they exhibit pathological behavior -# https://github.com/ros2/build_farmer/issues/248 -if sys.platform.startswith('win'): - pytest.skip( - 'CLI tests can block for a pathological amount of time on Windows.', - allow_module_level=True) - - def get_echo_call_output(**kwargs): request = BasicTypes.Request() for field_name, field_value in kwargs.items(): diff --git a/ros2topic/test/test_cli.py b/ros2topic/test/test_cli.py index 7b361f0ce..800c61f98 100644 --- a/ros2topic/test/test_cli.py +++ b/ros2topic/test/test_cli.py @@ -37,14 +37,6 @@ from rclpy.utilities import get_available_rmw_implementations -# Skip cli tests on Windows while they exhibit pathological behavior -# https://github.com/ros2/build_farmer/issues/248 -if sys.platform.startswith('win'): - pytest.skip( - 'CLI tests can block for a pathological amount of time on Windows.', - allow_module_level=True) - - @pytest.mark.rostest @launch_testing.parametrize('rmw_implementation', get_available_rmw_implementations()) def generate_test_description(rmw_implementation): diff --git a/ros2topic/test/test_echo_pub.py b/ros2topic/test/test_echo_pub.py index 7f41b6d87..4b6d62c19 100644 --- a/ros2topic/test/test_echo_pub.py +++ b/ros2topic/test/test_echo_pub.py @@ -13,7 +13,6 @@ # limitations under the License. import functools -import sys import unittest from launch import LaunchDescription @@ -38,14 +37,6 @@ from std_msgs.msg import String -# Skip cli tests on Windows while they exhibit pathological behavior -# https://github.com/ros2/build_farmer/issues/248 -if sys.platform.startswith('win'): - pytest.skip( - 'CLI tests can block for a pathological amount of time on Windows.', - allow_module_level=True) - - TEST_NODE = 'cli_echo_pub_test_node' TEST_NAMESPACE = 'cli_echo_pub' From f5957413c6ce651e91ae6b29f689c5d1ea77b63e Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Wed, 13 Jan 2021 10:26:09 -0300 Subject: [PATCH 2/6] Fix failing tests on Linux Signed-off-by: Michel Hidalgo --- ros2interface/test/test_cli.py | 1 + ros2topic/test/test_cli.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ros2interface/test/test_cli.py b/ros2interface/test/test_cli.py index 211ce89c5..9b75cae2a 100644 --- a/ros2interface/test/test_cli.py +++ b/ros2interface/test/test_cli.py @@ -15,6 +15,7 @@ import contextlib import itertools import re +import sys import unittest from launch import LaunchDescription diff --git a/ros2topic/test/test_cli.py b/ros2topic/test/test_cli.py index 800c61f98..76edc79d0 100644 --- a/ros2topic/test/test_cli.py +++ b/ros2topic/test/test_cli.py @@ -759,8 +759,8 @@ def test_topic_bw(self): assert topic_command.wait_for_output(functools.partial( launch_testing.tools.expect_output, expected_lines=[ 'Subscribed to [/defaults]', - re.compile(r'\d{2} B/s from \d+ messages'), - re.compile(r'\s*Message size mean: \d{2} B min: \d{2} B max: \d{2} B') + re.compile(r'\d{2,3} B/s from \d+ messages'), + re.compile(r'\s*Message size mean: \d{2,3} B min: \d{2,3} B max: \d{2,3} B') ], strict=True ), timeout=10) assert topic_command.wait_for_shutdown(timeout=10) From 0b0b7359bdbac48fd5c82babec83ebf6583d2e3b Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Wed, 17 Feb 2021 18:36:15 -0300 Subject: [PATCH 3/6] Bump ros2 topic delay tolerance. Signed-off-by: Michel Hidalgo --- ros2topic/test/test_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ros2topic/test/test_cli.py b/ros2topic/test/test_cli.py index 76edc79d0..601684b9e 100644 --- a/ros2topic/test/test_cli.py +++ b/ros2topic/test/test_cli.py @@ -708,7 +708,7 @@ def test_topic_delay(self): head_line = topic_command.output.splitlines()[0] average_delay = float(average_delay_line_pattern.match(head_line).group(1)) - assert math.isclose(average_delay, 0.0, abs_tol=10e-3) + assert math.isclose(average_delay, 0.0, abs_tol=0.1) @launch_testing.markers.retry_on_failure(times=5, delay=1) def test_topic_hz(self): From f57d8bdfda0a36e8328e0e982fc4e78687168a04 Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Thu, 18 Feb 2021 18:37:41 -0300 Subject: [PATCH 4/6] Bump ros2 action info timeout. Signed-off-by: Michel Hidalgo --- ros2action/test/test_cli.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ros2action/test/test_cli.py b/ros2action/test/test_cli.py index aeb352f77..d502892ed 100644 --- a/ros2action/test/test_cli.py +++ b/ros2action/test/test_cli.py @@ -124,7 +124,8 @@ def launch_action_command(self, arguments): def test_info_on_nonexistent_action(self): with self.launch_action_command(arguments=['info', '/not_an_action']) as action_command: - assert action_command.wait_for_shutdown(timeout=10) + timeout = 20 if os.name == 'nt' else 10 # ros2 action info is slower on Windows + assert action_command.wait_for_shutdown(timeout=timeout) assert action_command.exit_code == launch_testing.asserts.EXIT_OK assert launch_testing.tools.expect_output( expected_lines=[ @@ -139,7 +140,8 @@ def test_info_on_nonexistent_action(self): @launch_testing.markers.retry_on_failure(times=5, delay=1) def test_fibonacci_info(self): with self.launch_action_command(arguments=['info', '/fibonacci']) as action_command: - assert action_command.wait_for_shutdown(timeout=10) + timeout = 20 if os.name == 'nt' else 10 # ros2 action info is slower on Windows + assert action_command.wait_for_shutdown(timeout=timeout) assert action_command.exit_code == launch_testing.asserts.EXIT_OK assert launch_testing.tools.expect_output( expected_lines=[ @@ -155,7 +157,8 @@ def test_fibonacci_info(self): @launch_testing.markers.retry_on_failure(times=5, delay=1) def test_fibonacci_info_with_types(self): with self.launch_action_command(arguments=['info', '-t', '/fibonacci']) as action_command: - assert action_command.wait_for_shutdown(timeout=10) + timeout = 20 if os.name == 'nt' else 10 # ros2 action info is slower on Windows + assert action_command.wait_for_shutdown(timeout=timeout) assert action_command.exit_code == launch_testing.asserts.EXIT_OK assert launch_testing.tools.expect_output( expected_lines=[ @@ -171,7 +174,8 @@ def test_fibonacci_info_with_types(self): @launch_testing.markers.retry_on_failure(times=5, delay=1) def test_fibonacci_info_count(self): with self.launch_action_command(arguments=['info', '-c', '/fibonacci']) as action_command: - assert action_command.wait_for_shutdown(timeout=10) + timeout = 20 if os.name == 'nt' else 10 # ros2 action info is slower on Windows + assert action_command.wait_for_shutdown(timeout=timeout) assert action_command.exit_code == launch_testing.asserts.EXIT_OK assert launch_testing.tools.expect_output( expected_lines=[ From d9d440ab3bf236799eca2b590602e011baf219f8 Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Thu, 18 Feb 2021 18:39:47 -0300 Subject: [PATCH 5/6] Re-enable ros2 param dump tests on Windows. Signed-off-by: Michel Hidalgo --- ros2param/test/test_verb_dump.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ros2param/test/test_verb_dump.py b/ros2param/test/test_verb_dump.py index e1c72531b..79fc7b586 100644 --- a/ros2param/test/test_verb_dump.py +++ b/ros2param/test/test_verb_dump.py @@ -72,13 +72,6 @@ ' use_sim_time: false\n' ) -# Skip cli tests on Windows while they exhibit pathological behavior -# https://github.com/ros2/build_farmer/issues/248 -if sys.platform.startswith('win'): - pytest.skip( - 'CLI tests can block for a pathological amount of time on Windows.', - allow_module_level=True) - @pytest.mark.rostest @launch_testing.parametrize('rmw_implementation', get_available_rmw_implementations()) From c0d8da2ff47716b07dcc0f1821bf53efa0c9d021 Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Thu, 18 Feb 2021 18:41:14 -0300 Subject: [PATCH 6/6] Re-enable ros2 param load tests on Windows. Signed-off-by: Michel Hidalgo --- ros2param/test/test_verb_load.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ros2param/test/test_verb_load.py b/ros2param/test/test_verb_load.py index 0cfbbb43a..ac872a3b6 100644 --- a/ros2param/test/test_verb_load.py +++ b/ros2param/test/test_verb_load.py @@ -72,13 +72,6 @@ ' use_sim_time: false\n' ) -# Skip cli tests on Windows while they exhibit pathological behavior -# https://github.com/ros2/build_farmer/issues/248 -if sys.platform.startswith('win'): - pytest.skip( - 'CLI tests can block for a pathological amount of time on Windows.', - allow_module_level=True) - @pytest.mark.rostest @launch_testing.parametrize('rmw_implementation', get_available_rmw_implementations())