Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression on expected number of event handlers in test_qos_event #588

Closed
azeey opened this issue Jun 23, 2020 · 3 comments · Fixed by #603
Closed

Regression on expected number of event handlers in test_qos_event #588

azeey opened this issue Jun 23, 2020 · 3 comments · Fixed by #603
Assignees

Comments

@azeey
Copy link
Contributor

azeey commented Jun 23, 2020

Likely a regression from #572.

Failing build: http://build.ros2.org/view/Fci/job/Fci__nightly-cyclonedds_ubuntu_focal_amd64/145/testReport/junit/rclpy.src.ros2.rclpy.rclpy.test.test_qos_event/TestQoSEvent/test_subscription_constructor/

Output:

self = <test.test_qos_event.TestQoSEvent testMethod=test_subscription_constructor>

    def test_subscription_constructor(self):
        callbacks = SubscriptionEventCallbacks()
        liveliness_callback = Mock()
        deadline_callback = Mock()
        message_callback = Mock()
        incompatible_qos_callback = Mock()
        expected_num_event_handlers = 0 if self.is_fastrtps else 1
    
        # No arg
        subscription = self.node.create_subscription(
            EmptyMsg, self.topic_name, message_callback, 10)
        self.assertEqual(len(subscription.event_handlers), expected_num_event_handlers)
        self.node.destroy_subscription(subscription)
    
        # Arg with no callbacks
        subscription = self.node.create_subscription(
            EmptyMsg, self.topic_name, message_callback, 10, event_callbacks=callbacks)
        self.assertEqual(len(subscription.event_handlers), expected_num_event_handlers)
        self.node.destroy_subscription(subscription)
    
        # Arg with one of the callbacks
        callbacks.deadline = deadline_callback
        expected_num_event_handlers += 1
        subscription = self.node.create_subscription(
            EmptyMsg, self.topic_name, message_callback, 10, event_callbacks=callbacks)
        self.assertEqual(len(subscription.event_handlers), expected_num_event_handlers)
        self.node.destroy_subscription(subscription)
    
        # Arg with two callbacks
        callbacks.liveliness = liveliness_callback
        expected_num_event_handlers += 1
        subscription = self.node.create_subscription(
            EmptyMsg, self.topic_name, message_callback, 10, event_callbacks=callbacks)
        self.assertEqual(len(subscription.event_handlers), expected_num_event_handlers)
        self.node.destroy_subscription(subscription)
    
        # Arg with three callbacks
        callbacks.incompatible_qos = incompatible_qos_callback
        try:
            subscription = self.node.create_subscription(
                EmptyMsg, self.topic_name, message_callback, 10, event_callbacks=callbacks)
>           self.assertEqual(len(subscription.event_handlers), 3)
E           AssertionError: 4 != 3

../../src/ros2/rclpy/rclpy/test/test_qos_event.py:142: AssertionError
@dirk-thomas
Copy link
Member

Likely a regression from #572.

Since the test has been in every nightly since early March I don't think the referenced recent PR is the culprit.

@dirk-thomas
Copy link
Member

Since the test started failing after #497 I will go ahead and assign @ivanpauno to look into it.

@ivanpauno
Copy link
Member

Likely a regression from #572.

Since the test has been in every nightly since early March I don't think the referenced recent PR is the culprit.

There are two failures in the same test file.
One was introduced in #572 as @azeey pointed out, and is being fixed in #601.

I'm investigating the other failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants