-
Notifications
You must be signed in to change notification settings - Fork 427
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
fix events-executor warm-up bug and add unit-tests #2591
Conversation
Signed-off-by: Alberto Soragna <[email protected]>
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.
i think comments could be updated a bit, but this test itself makes sense to be added.
This test is flawed. It builds on top of TestExecutors. The SetUp method of TestExecutors also instantiates a node and subscripers / publishers interfering with the test. |
Signed-off-by: Alberto Soragna <[email protected]>
@jmachowinski I moved the tests to a new file with their own, minimal, test suite |
Signed-off-by: Alberto Soragna <[email protected]>
d2df4b0
to
77ddcd1
Compare
Signed-off-by: Alberto Soragna <[email protected]>
Signed-off-by: Alberto Soragna <[email protected]>
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/next-client-library-wg-meeting-friday-16th-august-2024/39130/1 |
@jmachowinski @fujitatomoya A friendly ping for one more round of review to move forward with this PR. |
Please :-) |
@Mergifyio update |
✅ Branch has been successfully updated |
@@ -0,0 +1,241 @@ | |||
// Copyright 2017 Open Source Robotics Foundation, Inc. |
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.
// Copyright 2017 Open Source Robotics Foundation, Inc. | |
// Copyright 2024 Open Source Robotics Foundation, Inc. |
// Create entities, this will produce a notifier waitable event, telling the executor to refresh | ||
// the entities collection | ||
auto publisher = node->create_publisher<test_msgs::msg::Empty>("test_topic", rclcpp::QoS(10)); | ||
size_t callback_count = 0; |
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.
include <cstddef>
auto callback = [&callback_count](test_msgs::msg::Empty::ConstSharedPtr) {callback_count++;}; | ||
auto subscription = | ||
node->create_subscription<test_msgs::msg::Empty>( | ||
"test_topic", rclcpp::QoS(10), std::move(callback)); |
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.
include <utility>
|
||
// TODO(alsora): Enable when https://github.com/ros2/rclcpp/pull/2595 gets merged | ||
if ( | ||
std::is_same<ExecutorType, rclcpp::executors::SingleThreadedExecutor>() || |
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.
include <type_traits>
RHEL is failing with out of disk space errors. Reported to buildfarmers. |
Signed-off-by: Alberto Soragna <[email protected]>
067b721
to
d3ed8a6
Compare
Merging this since the changes requests have been addressed and the RHEL failure is unrelated and known ( |
Can we get this backported to Jazzy? |
https://github.com/Mergifyio backport jazzy |
✅ Backports have been created
|
* add unit-test to verify that spin-all doesn't need warm-up Signed-off-by: Alberto Soragna <[email protected]> * improve comment and add callback group test Signed-off-by: Alberto Soragna <[email protected]> * move executor tests to a new file Signed-off-by: Alberto Soragna <[email protected]> * do not require warm up iteration with events executor spin_some Signed-off-by: Alberto Soragna <[email protected]> * add spin_some tests and cleanup Signed-off-by: Alberto Soragna <[email protected]> * add missing include directives Signed-off-by: Alberto Soragna <[email protected]> --------- Signed-off-by: Alberto Soragna <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit f7056c0) # Conflicts: # rclcpp/src/rclcpp/experimental/executors/events_executor/events_executor.cpp
Can we merge the backport to |
Ey @alsora I created the backport but there are some conflicts. do you mind to fix it ? I can take care of the release once the backport PR is merged |
Signed-off-by: Alberto Soragna <[email protected]>
…2628) Signed-off-by: Alberto Soragna <[email protected]>
Wrote a test to verify the behavior of
spin_all
, that should collect work multiple times (if given enough duration) and this should allow to also get work from entities created after the node / cb group was added to the executor.See #2589 for details