-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds a --max-wait-time
option to ros2 topic pub
#800
Adds a --max-wait-time
option to ros2 topic pub
#800
Conversation
When we run `ros2 topic pub -w 1 ...` we can wait for a fixed number of connections prior to shutting down. This is useful in many scenarios, however when writing automated tests it may be useful to time out if the correct number of connections are not recieved in a given amount of time. This PR adds a `--max-wait-time` option which allows users to set a timeout on how long to wait for subscribers. Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
Just as an FYI, in general we prefer rebases of old PRs rather than new PRs. That is, it would have been preferable here to keep #797 open, and just rebase it, rather than close it and make this new one. That keeps all of the conversations in the same place and ensures it is easier to follow later. That said, it is already done here, so let's just go forward with this one. |
Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
770ce08
to
58a16d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code that is here looks OK to me. However, I think we should have two additional tests:
- A test that shows that using
--max-wait-time-secs
without--wait-matching-subscriptions
immediately fails. - A test that shows that with a subscriber, we actually do eventually break out of the loop and publish something.
Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
Added tests in ccb2864 |
Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with green CI.
@arjo129 It looks like one of the new tests is triggering CI. Can you take a look? |
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Is it possible to check CI again? I've changed the problematic test case. |
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Supercedes #797
When we run
ros2 topic pub -w 1 ...
we can wait for a fixed numberof connections prior to shutting down. This is useful in many scenarios,
however when writing automated tests it may be useful to time out if the
correct number of connections are not recieved in a given amount of
time. This PR adds a
--max-wait-time
option which allows users to seta timeout on how long to wait for subscribers.
Signed-off-by: Arjo Chakravarty arjo@openrobotics.org