Skip to content

Fix test_intra_process_manager.cpp with rmw_zenoh_cpp#2653

Merged
Yadunund merged 3 commits intorollingfrom
clalancette/ipm-tests
Oct 18, 2024
Merged

Fix test_intra_process_manager.cpp with rmw_zenoh_cpp#2653
Yadunund merged 3 commits intorollingfrom
clalancette/ipm-tests

Conversation

@clalancette
Copy link
Copy Markdown
Contributor

There are 2 patches here:

  1. Make every pub and sub in test_intra_process_manager.cpp have to pass in both a topic name and a QoS when they are constructing mock pubs and subs for the intra-process manager test. This just makes it easier to tell whether the pubs and subs should be matched or not.
  2. The intra_process_manager will attempt to match QoS between publishers and subscriptions as they are added to the IPM. This is exactly correct, but the tests were not following the same pattern. Thus, when running these tests under Zenoh, the tests would fail because more things would match than the tests were expecting. Update the test to take the differences in QoS into account, which fixes the test under rmw_zenoh_cpp (and keeps it working for the existing DDS RMWs).

In particular, make every pub and sub have to
pass in both a topic name and a QoS when they
are constructing mock pubs and subs for the
intra-process manager test.  This just makes it
easier to tell whether the pubs and subs should be
matched or not.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
It turns out that the intra_process_manager will attempt to match
QoS between publishers and subscriptions as they are added to the IPM.
This is exactly correct, but the tests were not following the same
pattern.

Thus, when running these tests under Zenoh, the tests would fail
because more things would match than the tests were expecting.
Update the test to take the differences in QoS into account,
which fixes the test under rmw_zenoh_cpp (and keeps it working
for the existing DDS RMWs).

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@clalancette
Copy link
Copy Markdown
Contributor Author

Pulls: #2653
Gist: https://gist.githubusercontent.com/clalancette/7b0d3b2566c305f4e83f4975e88de1cf/raw/98cff5dda00dd9e6ef730123a6869a7501196762/ros2.repos
BUILD args: --packages-up-to rclcpp
TEST args: --packages-select rclcpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14710

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

Copy link
Copy Markdown
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with green CI

explicit PublisherBase(rclcpp::QoS qos = rclcpp::QoS(10))
: qos_profile(qos),
topic_name("topic")
explicit PublisherBase(const std::string & topic, rclcpp::QoS qos)
Copy link
Copy Markdown
Collaborator

@alsora alsora Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor

Suggested change
explicit PublisherBase(const std::string & topic, rclcpp::QoS qos)
PublisherBase(const std::string & topic, const rclcpp::QoS & qos)

the same change applies to the other constructors

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@ahcorde
Copy link
Copy Markdown
Contributor

ahcorde commented Oct 17, 2024

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@Yadunund Yadunund merged commit bcc1475 into rolling Oct 18, 2024
@Yadunund Yadunund deleted the clalancette/ipm-tests branch October 18, 2024 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants