Skip to content

πŸ§‘β€πŸŒΎ rclpy test subscription test regressionΒ #1505

@Crola1702

Description

@Crola1702

Generated by Generative AI

No response

Operating System:

Ubuntu noble

ROS version or commit hash:

Rolling

RMW implementation (if applicable):

Connext

RMW Configuration (if applicable):

No response

Client library (if applicable):

rclpy

'ros2 doctor --report' output

No response

Steps to reproduce issue

  1. Run a build in Rolling nightly connext
  2. See test regressions

Expected behavior

Tests should pass

Actual behavior

Tests are failing

Additional information

Reference build:

Test regressions:

Log output:

self = <Mock id='133622991097488'>, args = (1,), kwargs = {}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.12/unittest/mock.py:955: AssertionError

During handling of the above exception, another exception occurred:

test_node = <rclpy.node.Node object at 0x798786eb0290>

    def test_on_new_message_callback(test_node) -> None:
        topic_name = '/topic'
        cb = Mock()
        sub = test_node.create_subscription(
            msg_type=Empty,
            topic=topic_name,
            qos_profile=10,
            callback=cb)
        pub = test_node.create_publisher(Empty, topic_name, 10)
        sub.handle.set_on_new_message_callback(cb)
        cb.assert_not_called()
        pub.publish(Empty())
>       cb.assert_called_once_with(1)
E       AssertionError: Expected 'mock' to be called once. Called 0 times.

../../src/ros2/rclpy/rclpy/test/test_subscription.py:194: AssertionError

The errors:

Might be related to this issue, although I'm not sure, because those are timeouts

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions