Skip to content

test_publisher run_event_handler test fails with CycloneDDS #1475

@sloretz

Description

@sloretz

Bug report

Required Info:

  • Operating System:
    • Ubuntu Focal
  • Installation type:
    • From source
  • Version or commit hash:
    • master
  • DDS implementation:
    • CycloneDDS
  • Client library (if applicable):
    • rclcpp

Steps to reproduce issue

RMW_IMPLEMENTATION=rmw_cyclonedds_cpp build/rclcpp/test/rclcpp/test_publisher

Expected behavior

All tests should pass

Actual behavior

[ RUN      ] TestPublisher.run_event_handlers
1606261998.534775 [0] test_publi: using network interface enp3s0 (udp/192.168.1.150) selected arbitrarily from: enp3s0, docker0
[WARN] [1606261998.541156630] [ns.my_node]: New subscription discovered on topic '/ns/topic', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: INVALID_QOS_POLICY
/home/sloretz/bigssd/ros2/src/ros2/rclcpp/rclcpp/test/rclcpp/test_publisher.cpp:509: Failure
Expected: handler->execute(data) throws an exception of type std::runtime_error.
  Actual: it throws nothing.
[  FAILED  ] TestPublisher.run_event_handlers (11 ms)

Additional information

The test started failing since #1241, and reverting to the commit before resolves the test failure, but it's not clear to me if that PR introduced a bug or exposed an existing bug. Before the PR the test seemed to run the event handlers execute() method without any expectations. That PR changed the test to expect no events on a newly created publisher. When run with rmw_cyclonedds_cpp there is an event.

Stepping through rcl_take_event() shows RMW_EVENT_OFFERED_QOS_INCOMPATIBLE get's returned. Unfortunately I can't trace further. gdb refuses to step inside dds_get_offered_incompatible_qos_status(...). It appears to be defined by a macro STATUS_CB_IMPL in dds_writer.c.

It does not appear related to test_publisher.cpp reusing the same topic name between tests. The same error happens when the topic name is changed to something that does not exist elsewhere

[ RUN      ] TestPublisher.run_event_handlers
1606262628.746126 [0] test_publi: using network interface enp3s0 (udp/192.168.1.150) selected arbitrarily from: enp3s0, docker0
[WARN] [1606262628.752262631] [ns.my_node]: New subscription discovered on topic '/ns/topic_does_not_exist', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: INVALID_QOS_POLICY
/home/sloretz/bigssd/ros2/src/ros2/rclcpp/rclcpp/test/rclcpp/test_publisher.cpp:509: Failure
Expected: handler->execute(data) throws an exception of type std::runtime_error.
  Actual: it throws nothing.
[  FAILED  ] TestPublisher.run_event_handlers (11 ms)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions