Skip to content
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

Don't expect RCL_RET_TIMEOUT to set an error string #900

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

asorbini
Copy link
Contributor

Unit test TestActionCommunication::test_valid_feedback_comm_maybe_fail from rcl_action/test_action_communication.cpp expects an error string to always be set if the call to rcl_wait() returns anything other than RCL_RET_OK, including RCL_RET_TIMEOUT.

This causes the test to fail if an injected error causes the call to timeout. I have run into this occurrence while testing rmw_connextdds (see for example this recent test regression).

I had previously "solved" this failure by adding a call to RMW_SET_ERROR_MSG() in rmw_wait() when RMW_RET_TIMEOUT was returned. The test regression was caused by my recent decision of reverting this change, because generating an error string on every timeout caused a quite intrusive (and misleadingly worrisome) error message to be printed on what is really not an erroneous situation.

I'm not sure about the expectations in the ROS2 API, but assuming they are similar to those of the DDS API, I would suggest treating RCL_RET_TIMEOUT as a "special" non-OK return code, which doesn't signal an error, at the very least in the context of a WaitSet::wait().

The changes in this PR are required to make progress on rticommunity/rmw_connextdds#9 with "all green" CI tests.

Signed-off-by: Andrea Sorbini <asorbini@rti.com>
Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the improvement!

@ivanpauno
Copy link
Member

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@ivanpauno ivanpauno merged commit fc3f93b into ros2:master Mar 12, 2021
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