Failing test in CI: test_rclcpp gtest_subscription__rmw_connextdds

Open
#136 11 comments 0 reactions 2 assignees View on GitHub

@lobolanja is already working on this.

Since Feb 6, 2025.

Assessment

This issue has not been assessed yet.

Description

System Info

  • OS
    • Ubuntu 22.04
    • Windows
  • ROS version and installation type
    • rolling/source
  • RTI Connext DDS version and installation type
    • Connext Pro 6.0.1
  • RMW version or commit hash
    • rolling branch (a6053be96c4cddf4cece95424a68fbb54373e705 as of this writing)

Bug Description

If you run the gtest_subscription__rmw_connextdds test from the test_rclcpp package with no load, it "always" passes. It also "always" seems to pass in CI. However, if you put load on the machine, it fails very often, maybe like 75% of the time.

Expected Behavior

The test always passes, even with a lot of load on the machine.

How to Reproduce

In terminal 1, put a lot of stress on the machine. In my case:

$ stress --cpu 16

In terminal 2, run the test:

$ colcon test --event-handlers console_direct+ --packages-select test_rclcpp --ctest-args -R gtest_subscription__rmw_connextdds

You may have to adjust the amount of stress on the machine, and you may have to run the test a few times, but it should fail fairly quickly.

Workarounds

Mark this test as xfail.

Additional context

This same test works fine on Fast-DDS (gtest_subscription__rmw_fastrtps_cpp) and Cyclone DDS (gtest_subscription__rmw_cyclonedds_cpp), even with load on the machine.

This has come up now because we are about to merge in https://github.com/ros2/rclcpp/pull/2142, which seems to exacerbate this problem. However, I can produce this completely with rolling packages as of today, so it is not the fault of that PR.

I did some additional debugging to try to track this down. When it fails, the executor is waiting for new data to come in via rmw_wait via a condition variable: https://github.com/ros2/rmw_connextdds/blob/a6053be96c4cddf4cece95424a68fbb54373e705/rmw_connextdds_common/src/common/rmw_impl_waitset_std.cpp#L579 . The failure occurs because the condition variable never wakes up and times out. In turn, this suggests that the condition variable is never triggered.

That condition variable should be triggered when new data comes in via the on_data_available callback in the subscriber: https://github.com/ros2/rmw_connextdds/blob/a6053be96c4cddf4cece95424a68fbb54373e705/rmw_connextdds_common/src/common/rmw_impl_waitset_std.cpp#L131 . I've verified that it is installed to the listener at https://github.com/ros2/rmw_connextdds/blob/a6053be96c4cddf4cece95424a68fbb54373e705/rmw_connextdds_common/src/common/rmw_impl_waitset_std.cpp#L630 .

Finally, I've verified that the publisher side is indeed writing the data out via DDS_DataWriter_write_untypedI in message (https://github.com/ros2/rmw_connextdds/blob/a6053be96c4cddf4cece95424a68fbb54373e705/rmw_connextdds_common/src/ndds/dds_api_ndds.cpp#L771) .

So as far as I can tell, those are all of the pieces necessary to get this working, and it does work sometimes. But under load, it seems to fail. I could use some advice on how to debug this further.

In the meantime, I'm going to propose a PR to mark that particular test as xfail so we can make progress on the other PRs.

Dominant language
C++
Stars
68
Forks
42
Avg merge
9d 15h
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ros2/rmw_connextdds

All issues in ros2/rmw_connextdds

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.