Skip to content

Conversation

@LastStarDust
Copy link
Contributor

@LastStarDust LastStarDust commented Oct 1, 2025

Description

During my tests, I noticed that explicitly setting the QoS profile made a big difference in terms of reproducibility and flakiness.

Before, it would happen that integration tests using the WaitForTopics class would randomly fail with timeout errors, probably due to messages not being received by a subscriber. During integration tests where the input and output of a node are cross-checked for consistency, even the loss of a single message can make the test fail which may be unacceptable, for example, in CI workflows that require 100% repeatability.

In particular, enforcing QoS policy reliability to “RELIABLE” and QoS policy durability to “TRANSIENT_LOCAL” decreased the chances of tests randomly failing by orders of magnitude.

This is expected, since these options help ensure that all messages are received. Otherwise, in the case of network or other transient issues, a message might get lost, causing the integration test to fail.


Did you use Generative AI?

No


Additional Information

It would be nice if this is backported to Jazzy

@LastStarDust LastStarDust force-pushed the feature/wait-for-topics-qos branch 3 times, most recently from 2a61e63 to 9ca2014 Compare October 1, 2025 04:48
@LastStarDust LastStarDust marked this pull request as ready for review October 1, 2025 04:53
Signed-off-by: Giorgio Pintaudi <[email protected]>

When testing subscribers and  publishers, usually we do not want to miss any message due to race issues or other network instabilities. So we give the option to the user to specify a QoS profile best suited for the test scenario. The default is to set the durability to transient local, so that the publisher do not drop any packages in case of late joining subscribers.
Copy link
Member

@christophebedard christophebedard left a comment

Choose a reason for hiding this comment

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

LGTM, sorry for the delay

@christophebedard
Copy link
Member

christophebedard commented Nov 17, 2025

Pulls: #493
Gist: https://gist.githubusercontent.com/christophebedard/3e8535d975d07c0f31e0df2bb462fb13/raw/91355d28a4ceedce420bc5ef8cf23614f5403922/ros2.repos
BUILD args: --packages-above-and-dependencies launch_testing_ros
TEST args: --packages-above launch_testing_ros
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/17512

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

@christophebedard
Copy link
Member

Finally, CI is green!

@christophebedard christophebedard merged commit 9052766 into ros2:rolling Nov 19, 2025
3 checks passed
@LastStarDust LastStarDust deleted the feature/wait-for-topics-qos branch November 19, 2025 06:02
ahcorde pushed a commit that referenced this pull request Nov 19, 2025
Signed-off-by: Giorgio Pintaudi <[email protected]>

When testing subscribers and  publishers, usually we do not want to miss any message due to race issues or other network instabilities. So we give the option to the user to specify a QoS profile best suited for the test scenario. The default is to set the durability to transient local, so that the publisher do not drop any packages in case of late joining subscribers.
ahcorde pushed a commit that referenced this pull request Nov 19, 2025
Signed-off-by: Giorgio Pintaudi <[email protected]>

When testing subscribers and  publishers, usually we do not want to miss any message due to race issues or other network instabilities. So we give the option to the user to specify a QoS profile best suited for the test scenario. The default is to set the durability to transient local, so that the publisher do not drop any packages in case of late joining subscribers.
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.

2 participants