From 211da41d6d89e8fe7076d259909b7fef30787bff Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Thu, 12 Mar 2020 12:28:19 -0500 Subject: [PATCH] Don't check lifespan on subscriber QoS (#523) Similar to changes in ros2/rcl#571 and ros2/rclcpp#1002 Fixes CI issue http://build.ros2.org/view/Fci/job/Fci__nightly-cyclonedds_ubuntu_focal_amd64/lastCompletedBuild/testReport/rclpy.src.ros2.rclpy.rclpy.test.test_node/TestNodeAllowUndeclaredParameters/test_get_publishers_subscriptions_info_by_topic/ Signed-off-by: Dan Rose --- rclpy/test/test_node.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/rclpy/test/test_node.py b/rclpy/test/test_node.py index 0229ce94f..cca8d3885 100644 --- a/rclpy/test/test_node.py +++ b/rclpy/test/test_node.py @@ -177,7 +177,7 @@ def test_node_names_and_namespaces(self): # test that it doesn't raise self.node.get_node_names_and_namespaces() - def assert_qos_equal(self, expected_qos_profile, actual_qos_profile): + def assert_qos_equal(self, expected_qos_profile, actual_qos_profile, *, is_publisher): # Depth and history are skipped because they are not retrieved. self.assertEqual( expected_qos_profile.durability, @@ -187,10 +187,11 @@ def assert_qos_equal(self, expected_qos_profile, actual_qos_profile): expected_qos_profile.reliability, actual_qos_profile.reliability, 'Reliability is unequal') - self.assertEqual( - expected_qos_profile.lifespan, - actual_qos_profile.lifespan, - 'lifespan is unequal') + if is_publisher: + self.assertEqual( + expected_qos_profile.lifespan, + actual_qos_profile.lifespan, + 'lifespan is unequal') self.assertEqual( expected_qos_profile.deadline, actual_qos_profile.deadline, @@ -232,7 +233,7 @@ def test_get_publishers_subscriptions_info_by_topic(self): self.assertEqual(self.node.get_namespace(), publisher_list[0].node_namespace) self.assertEqual('test_msgs/msg/BasicTypes', publisher_list[0].topic_type) actual_qos_profile = publisher_list[0].qos_profile - self.assert_qos_equal(qos_profile, actual_qos_profile) + self.assert_qos_equal(qos_profile, actual_qos_profile, is_publisher=True) # Add a subscription qos_profile2 = QoSProfile( @@ -257,8 +258,8 @@ def test_get_publishers_subscriptions_info_by_topic(self): self.assertEqual('test_msgs/msg/BasicTypes', subscription_list[0].topic_type) publisher_qos_profile = publisher_list[0].qos_profile subscription_qos_profile = subscription_list[0].qos_profile - self.assert_qos_equal(qos_profile, publisher_qos_profile) - self.assert_qos_equal(qos_profile2, subscription_qos_profile) + self.assert_qos_equal(qos_profile, publisher_qos_profile, is_publisher=True) + self.assert_qos_equal(qos_profile2, subscription_qos_profile, is_publisher=False) # Error cases with self.assertRaisesRegex(TypeError, 'bad argument type for built-in operation'):