Skip to content

test :- add test for subscriber queue size behavior (Fixes #421) - #3299

Open
Aaravanand00 wants to merge 1 commit into
ros2:rollingfrom
Aaravanand00:add-subscriber-queue-size-test
Open

Aaravanand00 wants to merge 1 commit into
ros2:rollingfrom
Aaravanand00:add-subscriber-queue-size-test

Conversation

@Aaravanand00

Copy link
Copy Markdown

Description

This PR adds a missing test in test_subscription.cpp to verify the behavior of a subscriber when its queue size (depth) is reached.
It ensures that when a publisher rapidly publishes more messages than the subscriber's configured queue size (with KEEP_LAST history), the subscriber's RMW queue correctly behaves according to QoS settings and delivers only up to depth number of messages.

Fixes #421

Is this user-facing behavior change?

No. This only adds a new test to the test suite to improve coverage.

Did you use Generative AI?

yes for testing the structure

Additional Information

The new test queue_size_behavior uses test_msgs::msg::BasicTypes. It sets up a subscriber with a queue depth of 3, waits for discovery, rapidly publishes 5 messages, and then spins to verify that the subscriber correctly receives exactly 3 messages without overflowing.

…2#421)

Signed-off-by: Aaravanand <aaravanand@gmail.com>
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.

add test to check behavior when the queue size of the subscriber is reached

1 participant