fix events-executor warm-up bug and add unit-tests#2591
Conversation
Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com>
fujitatomoya
left a comment
There was a problem hiding this comment.
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 <alberto.soragna@gmail.com>
|
@jmachowinski I moved the tests to a new file with their own, minimal, test suite |
Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com>
d2df4b0 to
77ddcd1
Compare
Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com>
Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com>
|
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.
| // 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; |
| 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)); |
|
|
||
| // TODO(alsora): Enable when https://github.com/ros2/rclcpp/pull/2595 gets merged | ||
| if ( | ||
| std::is_same<ExecutorType, rclcpp::executors::SingleThreadedExecutor>() || |
|
RHEL is failing with out of disk space errors. Reported to buildfarmers. |
Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com>
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 createdDetails
|
* add unit-test to verify that spin-all doesn't need warm-up Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com> * improve comment and add callback group test Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com> * move executor tests to a new file Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com> * do not require warm up iteration with events executor spin_some Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com> * add spin_some tests and cleanup Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com> * add missing include directives Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com> --------- Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com> 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 <alberto.soragna@gmail.com>
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