Don't expect RCL_RET_TIMEOUT to set an error string #900
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unit test
TestActionCommunication::test_valid_feedback_comm_maybe_fail
fromrcl_action/test_action_communication.cpp
expects an error string to always be set if the call torcl_wait()
returns anything other thanRCL_RET_OK
, includingRCL_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()
inrmw_wait()
whenRMW_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 aWaitSet::wait()
.The changes in this PR are required to make progress on rticommunity/rmw_connextdds#9 with "all green" CI tests.