-
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
Add fault injection macros and unit tests to rcl_action #730
Conversation
22f5b89
to
cbf2ceb
Compare
d516d81
to
0b47bc0
Compare
cbf2ceb
to
72389f8
Compare
d46603e
to
0c9dfc5
Compare
6f74d7d
to
95b9d7b
Compare
0c9dfc5
to
9fb197f
Compare
95b9d7b
to
523fc90
Compare
52b17b4
to
931c347
Compare
931c347
to
fc4ac47
Compare
fc4ac47
to
3cbe382
Compare
Rebased this PR on master after merging #727. This depends on ros2/rmw#254 Testing against current ros 2 branches, but with the fault-injection branch for |
3cbe382
to
8d502e2
Compare
Signed-off-by: Stephen Brawner <brawner@gmail.com>
I believe the failures in these unit tests are addressed by: |
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.
Some questions
8d502e2
to
7e508d4
Compare
Signed-off-by: Stephen Brawner <brawner@gmail.com>
7e508d4
to
e4f7f0c
Compare
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
rcl_node_t node = rcl_get_zero_initialized_node(); | ||
rcl_node_options_t node_options = rcl_node_get_default_options(); | ||
std::string node_name = std::string("test_action_client_node_") + std::to_string(count); | ||
rcl_ret_t ret = rcl_node_init(&node, node_name.c_str(), "", &this->context, &node_options); |
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.
@brawner meta: should this be outside the loop?
We haven't agreed on this, but I think it'd be good to minimize the overlap between fault injection tests. It's an expensive test and the more stuff we add the harder it is to track it down. WDYT?
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.
Seems reasonable. Moved non rcl_action code outside of this macro loop.
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.
Uh, I don't see it here. Refreshing Github's UI won't do either 🤔
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.
Hmm, phantom code change I see. Fixed again
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; | ||
rcl_context_t context = rcl_get_zero_initialized_context(); | ||
ret = rcl_init(0, nullptr, &init_options, &context); | ||
ASSERT_EQ(RCL_RET_OK, ret) << 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.
@brawner missing shutdown
/fini
counterpart?
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.
Added.
rcl_node_t node = rcl_get_zero_initialized_node(); | ||
rcl_node_options_t node_options = rcl_node_get_default_options(); | ||
ret = rcl_node_init(&node, "test_action_server_node", "", &context, &node_options); | ||
ASSERT_EQ(RCL_RET_OK, ret) << 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.
@brawner missing fini
counterpart?
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.
Added.
rcl_allocator_t allocator = rcl_get_default_allocator(); | ||
rcl_init_options_t init_options = rcl_get_zero_initialized_init_options(); | ||
rcl_ret_t ret = rcl_init_options_init(&init_options, allocator); | ||
ASSERT_EQ(RCL_RET_OK, ret) << 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.
@brawner missing fini
counterpart?
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.
Added.
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.
Overall LGTM!
EXPECT_EQ(RCL_RET_OK, rcl_node_fini(&node)); | ||
EXPECT_EQ(RCL_RET_OK, rcl_node_options_fini(&node_options)); | ||
} | ||
); |
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.
@brawner uncrustify
here?
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.
Uncrustify was happy, but combined lines 997 and 998.
rcl_node_t node = rcl_get_zero_initialized_node(); | ||
rcl_node_options_t node_options = rcl_node_get_default_options(); | ||
std::string node_name = std::string("test_action_client_node_") + std::to_string(count); | ||
rcl_ret_t ret = rcl_node_init(&node, node_name.c_str(), "", &this->context, &node_options); |
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.
Uh, I don't see it here. Refreshing Github's UI won't do either 🤔
Rpr job is still waiting for debian package of |
* Add fault injection macros and unit tests to rcl_action Signed-off-by: Stephen Brawner <brawner@gmail.com> * Addressing feedback Signed-off-by: Stephen Brawner <brawner@gmail.com> * PR Fixup Signed-off-by: Stephen Brawner <brawner@gmail.com> * PR Fixup Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Add fault injection macros and unit tests to rcl_action Signed-off-by: Stephen Brawner <brawner@gmail.com> * Addressing feedback Signed-off-by: Stephen Brawner <brawner@gmail.com> * PR Fixup Signed-off-by: Stephen Brawner <brawner@gmail.com> * PR Fixup Signed-off-by: Stephen Brawner <brawner@gmail.com>
Adding fault injection unit tests and macros to rcl_action. This CI will fail without a PR to rmw_fastrtps_cpp, which will come shortly. As will CI tests.
Edit:
rmw_fastrtps_cpp
bug fix: ros2/rmw_fastrtps#416Signed-off-by: Stephen Brawner brawner@gmail.com