-
Notifications
You must be signed in to change notification settings - Fork 163
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apojomovsky here and everywhere else it applies, consider using {}
instead.
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.
done!
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, expect cancel and result requests are false
.
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.
done, thanks!
&this->is_status_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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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);
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.
done, thanks!
@@ -275,8 +266,7 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_goal_c | |||
} | |||
|
|||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, got confused about that. done, thanks!
ret = rcl_wait_set_fini(&wait_set); | ||
&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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also,
EXPECT_FALSE(this->is_goal_request_ready);
EXPECT_TRUE(this->is_cancel_request_ready);
EXPECT_FALSE(this->is_result_request_ready);
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.
done, thanks!
&this->is_status_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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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);
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.
done, thanks!
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str; | ||
rcl_reset_error(); | ||
|
||
ret = rcl_action_server_wait_set_get_entities_ready( | ||
&wait_set, | ||
&this->wait_set_server, | ||
&this->action_server, | ||
&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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check ready flags for expected values.
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.
done, thanks!
&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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check ready flags for expected values.
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.
done, thanks!
&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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
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.
done, thanks!
&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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
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.
done, thanks!
&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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
done!
f21c3d8
to
aead129
Compare
Thanks for the review guys, just finished addressing your comments. |
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.
LGTM pending green CI
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: