ros2 / ros2cli

ROS 2 command line interface tools
Apache License 2.0
172 stars 161 forks source link

Adds a `--max-wait-time` option to `ros2 topic pub` #800

Closed arjo129 closed 1 year ago

arjo129 commented 1 year ago

Supercedes #797

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

clalancette commented 1 year ago

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.

arjo129 commented 1 year ago

Added tests in ccb2864

clalancette commented 1 year ago

CI:

clalancette commented 1 year ago

@arjo129 It looks like one of the new tests is triggering CI. Can you take a look?

arjo129 commented 1 year ago

Is it possible to check CI again? I've changed the problematic test case.

clalancette commented 1 year ago

CI:

clalancette commented 1 year ago

Another try with flake8 warnings fixed: