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

Add fault injection macros and unit tests to rcl_action #730

Merged
merged 4 commits into from
Aug 31, 2020

Conversation

brawner
Copy link
Contributor

@brawner brawner commented Jul 29, 2020

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#416

Signed-off-by: Stephen Brawner brawner@gmail.com

@brawner brawner self-assigned this Jul 29, 2020
@brawner brawner force-pushed the brawner/rcl_action-fault-injection-macros branch 3 times, most recently from 22f5b89 to cbf2ceb Compare August 12, 2020 21:14
@brawner brawner force-pushed the brawner/fault-injection-macros branch 2 times, most recently from d516d81 to 0b47bc0 Compare August 12, 2020 21:56
@brawner brawner force-pushed the brawner/rcl_action-fault-injection-macros branch from cbf2ceb to 72389f8 Compare August 12, 2020 21:56
@brawner brawner force-pushed the brawner/fault-injection-macros branch 2 times, most recently from d46603e to 0c9dfc5 Compare August 12, 2020 22:00
@brawner brawner force-pushed the brawner/rcl_action-fault-injection-macros branch 2 times, most recently from 6f74d7d to 95b9d7b Compare August 12, 2020 22:06
@brawner brawner force-pushed the brawner/fault-injection-macros branch from 0c9dfc5 to 9fb197f Compare August 12, 2020 22:09
@brawner brawner force-pushed the brawner/rcl_action-fault-injection-macros branch from 95b9d7b to 523fc90 Compare August 12, 2020 22:10
@brawner
Copy link
Contributor Author

brawner commented Aug 12, 2020

Builds and tests of the following packages rcutils, rcl_logging_spdlog, rosidl_typesupport_c, rosidl_typesupport_cpp, rcl, rcl_action, rcl_lifecycle, rosidl_runtime_c, rmw_dds_common, rmw

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

@brawner brawner force-pushed the brawner/rcl_action-fault-injection-macros branch 3 times, most recently from 52b17b4 to 931c347 Compare August 17, 2020 17:42
@brawner brawner force-pushed the brawner/rcl_action-fault-injection-macros branch from 931c347 to fc4ac47 Compare August 27, 2020 18:26
@brawner brawner changed the base branch from brawner/fault-injection-macros to master August 27, 2020 18:27
@brawner brawner marked this pull request as ready for review August 27, 2020 18:27
@brawner brawner force-pushed the brawner/rcl_action-fault-injection-macros branch from fc4ac47 to 3cbe382 Compare August 27, 2020 18:27
@brawner
Copy link
Contributor Author

brawner commented Aug 27, 2020

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 rmw and this PR branch (--packages-select rcl_action)

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

@brawner brawner force-pushed the brawner/rcl_action-fault-injection-macros branch from 3cbe382 to 8d502e2 Compare August 27, 2020 19:00
Signed-off-by: Stephen Brawner <brawner@gmail.com>
@brawner
Copy link
Contributor Author

brawner commented Aug 27, 2020

I believe the failures in these unit tests are addressed by:
ros2/rmw_fastrtps#427
#770

Copy link
Contributor

@Blast545 Blast545 left a comment

Choose a reason for hiding this comment

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

Some questions

@brawner brawner force-pushed the brawner/rcl_action-fault-injection-macros branch from 8d502e2 to 7e508d4 Compare August 27, 2020 23:11
Signed-off-by: Stephen Brawner <brawner@gmail.com>
@brawner brawner force-pushed the brawner/rcl_action-fault-injection-macros branch from 7e508d4 to e4f7f0c Compare August 27, 2020 23:15
Copy link
Contributor

@Blast545 Blast545 left a 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);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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 🤔

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

@brawner missing fini counterpart?

Copy link
Contributor Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

@brawner missing fini counterpart?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

Signed-off-by: Stephen Brawner <brawner@gmail.com>
Copy link
Contributor

@hidmic hidmic left a 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));
}
);
Copy link
Contributor

Choose a reason for hiding this comment

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

@brawner uncrustify here?

Copy link
Contributor Author

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);
Copy link
Contributor

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 🤔

Signed-off-by: Stephen Brawner <brawner@gmail.com>
@brawner
Copy link
Contributor Author

brawner commented Aug 31, 2020

Above bug fixes I referenced above have been merged. Testing again

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

@brawner
Copy link
Contributor Author

brawner commented Aug 31, 2020

Rpr job is still waiting for debian package of rcutils, but all ci.ros2.org jobs succeeded.

@brawner brawner merged commit 3683c6f into master Aug 31, 2020
@delete-merged-branch delete-merged-branch bot deleted the brawner/rcl_action-fault-injection-macros branch August 31, 2020 19:16
ahcorde pushed a commit that referenced this pull request Oct 8, 2020
* 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>
ahcorde pushed a commit that referenced this pull request Oct 23, 2020
* 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>
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.

3 participants