Repository navigation
Completes integration tests for action client/server - #331
Conversation
33bc503 to
9ab994e
Compare
Added action cancel test Added action result communication test Added action status communication test Added action feedback communication test Fix wrong return code in action client
9ab994e to
4ee3182
Compare
|
|
||
| bool is_goal_request_ready(false); | ||
| bool is_cancel_request_ready(false); | ||
| bool is_result_request_ready(false); |
There was a problem hiding this comment.
@apojomovsky here and everywhere else it applies, consider using {} instead.
| num_services, // number_of_services | ||
| rcl_get_default_allocator()); | ||
| EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str; | ||
| rcl_reset_error(); |
There was a problem hiding this comment.
@apojomovsky considering that above's pattern of wait set initialization repeats quite often for both server and client, I believe we can push out to SetUp() and Teardown() methods.
There was a problem hiding this comment.
Good point, just did as suggested. thanks!
| ret = rcl_wait_set_fini(&wait_set); | ||
| EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str; | ||
| rcl_reset_error(); | ||
| EXPECT_EQ(this->is_goal_request_ready, true) << rcl_get_error_string().str; |
There was a problem hiding this comment.
Also, expect cancel and result requests are false.
| &this->is_cancel_response_ready, | ||
| &this->is_result_response_ready); | ||
|
|
||
| EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str; |
There was a problem hiding this comment.
Also:
EXPECT_FALSE(this->is_feedback_ready);
EXPECT_FALSE(this->is_status_ready);
EXPECT_TRUE(this->is_goal_response_ready);
EXPECT_FALSE(this->is_cancel_response_ready);
EXPECT_FALSE(this->is_result_response_ready);
|
|
||
| TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_cancel_comm) | ||
| { | ||
| TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_cancel_comm) { |
There was a problem hiding this comment.
style nit: I think the brace should go on the next line, following the style guide for functions.
There was a problem hiding this comment.
Oops, got confused about that. done, thanks!
| &this->is_goal_request_ready, | ||
| &this->is_cancel_request_ready, | ||
| &this->is_result_request_ready); | ||
| EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str; |
There was a problem hiding this comment.
Also,
EXPECT_FALSE(this->is_goal_request_ready);
EXPECT_TRUE(this->is_cancel_request_ready);
EXPECT_FALSE(this->is_result_request_ready);
| &this->is_goal_response_ready, | ||
| &this->is_cancel_response_ready, | ||
| &this->is_result_response_ready); | ||
| EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str; |
There was a problem hiding this comment.
Also,
EXPECT_FALSE(this->is_feedback_ready);
EXPECT_FALSE(this->is_status_ready);
EXPECT_FALSE(this->is_goal_response_ready);
EXPECT_TRUE(this->is_cancel_response_ready);
EXPECT_FALSE(this->is_result_response_ready);
| &is_goal_request_ready, | ||
| &is_cancel_request_ready, | ||
| &is_result_request_ready); | ||
| EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str; |
There was a problem hiding this comment.
Check ready flags for expected values.
| &this->is_status_ready, | ||
| &this->is_goal_response_ready, | ||
| &this->is_cancel_response_ready, | ||
| &this->is_result_response_ready); |
There was a problem hiding this comment.
Check ready flags for expected values.
| &this->is_status_ready, | ||
| &this->is_goal_response_ready, | ||
| &this->is_cancel_response_ready, | ||
| &this->is_result_response_ready); |
| &this->is_status_ready, | ||
| &this->is_goal_response_ready, | ||
| &this->is_cancel_response_ready, | ||
| &this->is_result_response_ready); |
| &this->num_clients_client, | ||
| &this->num_services_client); | ||
| ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str; | ||
| ret = rcl_wait_set_init( |
There was a problem hiding this comment.
Alternatively, the action wait set functions should support multiple clients/servers per wait set. i.e. we can put the action client and server into a single wait set. I'm fine leaving these tests using two wait sets though, I'll leave it up to you.
There was a problem hiding this comment.
That's a good detail, I thought I needed individual wait sets here. Using a single one looks a lot cleaner, will simplify that now.
f21c3d8 to
aead129
Compare
|
Thanks for the review guys, just finished addressing your comments. |
|
CI is passing so I'll merge this one and send a separate PR with the tests that exercise the examples |
|
The new test failed on one of the last nightly jobs: https://ci.ros2.org/view/nightly/job/nightly_linux-aarch64_debug/651/testReport/ Also do you still need the branch or can it be deleted? |
|
Sorry for that @dirk-thomas , this seems to be related to using tight timeouts in the wait_sets, will send a fix for that shortly. |
|
Please update these tests to actually check if they work for each rmw implementation. Currently they only test the default and won't allow is to catch regressions in any other typesupport. |
Closes #328. It builds on top of the work done for #323. At the end, this PR must included tests for: