Conversation
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
|
Pulls: #442 |
fujitatomoya
left a comment
There was a problem hiding this comment.
@SuperJappie08 can you review this?
There was a problem hiding this comment.
Pull request overview
This PR fixes test failures in the rclc action client tests by addressing two key issues: replacing the deprecated rclcpp::spin_some(Node::SharedPtr) API with an executor-based approach, and fixing ROS 2 context initialization problems that occurred when running multiple tests sequentially.
Changes:
- Replaced deprecated
rclcpp::spin_some()with explicit executor usage - Added conditional
rclcpp::init()check to prevent multiple initialization failures - Ensured proper cleanup order for rclcpp resources before shutdown
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fujitatomoya
left a comment
There was a problem hiding this comment.
i think this has been broke for certain time? but this fixes a couple of problems in my local environment.
SuperJappie08
left a comment
There was a problem hiding this comment.
@fujitatomoya, I have some concerns about the rclcpp::Context check.
(See the comment)
However, I don't have much experience with complex testing for rclcpp (and rclc). So I might be a bit too cautious.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
fujitatomoya
left a comment
There was a problem hiding this comment.
this became much bigger than i expected. but it just replaces rclcpp methods into rclc function for the test. i believe this is good for test integrity for rclc pacakge, and it can avoid the inconsistency between rclcpp and rclc interfaces and behaviors.
|
Pulls: #442 |
|
@fujitatomoya, I might have time to review tomorrow. |
@SuperJappie08 this PR tries to fix |
|
rpr jobs complains the following. https://build.ros2.org/job/Rpr__rclc__ubuntu_noble_amd64/41/console 09:00:38 1: Test command: /usr/bin/python3 "-u" "/opt/ros/rolling/share/ament_cmake_test/cmake/run_test.py" "/tmp/ws/test_results/rclc_lifecycle/rclc_lifecycle_test.gtest.xml" "--package-name" "rclc_lifecycle" "--output-file" "/tmp/ws/build_isolated/rclc_lifecycle/ament_cmake_gtest/rclc_lifecycle_test.txt" "--command" "/tmp/ws/build_isolated/rclc_lifecycle/rclc_lifecycle_test" "--gtest_output=xml:/tmp/ws/test_results/rclc_lifecycle/rclc_lifecycle_test.gtest.xml"
09:00:38 1: Working Directory: /tmp/ws/build_isolated/rclc_lifecycle
09:00:38 1: Test timeout computed to be: 60
09:00:38 1: -- run_test.py: invoking following command in '/tmp/ws/build_isolated/rclc_lifecycle':
09:00:38 1: - /tmp/ws/build_isolated/rclc_lifecycle/rclc_lifecycle_test --gtest_output=xml:/tmp/ws/test_results/rclc_lifecycle/rclc_lifecycle_test.gtest.xml
09:00:38 1: Running main() from /opt/ros/rolling/src/gtest_vendor/src/gtest_main.cc
09:00:38 1: [==========] Running 4 tests from 1 test suite.
09:00:38 1: [----------] Global test environment set-up.
09:00:38 1: [----------] 4 tests from TestRclcLifecycle
09:00:38 1: [ RUN ] TestRclcLifecycle.lifecycle_node
09:00:38 1: [ OK ] TestRclcLifecycle.lifecycle_node (15 ms)
09:00:38 1: [ RUN ] TestRclcLifecycle.lifecycle_node_transitions
09:00:38 1: -- run_test.py: return code -11
09:00:38 1: -- run_test.py: generate result file '/tmp/ws/test_results/rclc_lifecycle/rclc_lifecycle_test.gtest.xml' with failed test
09:00:38 1: -- run_test.py: verify result file '/tmp/ws/test_results/rclc_lifecycle/rclc_lifecycle_test.gtest.xml'
09:00:38 1/7 Test #1: rclc_lifecycle_test ..............***Failed 0.21 secwhich is really strange, because this PR only changes |
|
@JanStaschulat @Carlosespicur @EugenioCollado can you review and merge this since you are maintainers? |
|
@fujitatomoya, I did some digging, and exit code 11 probably corresponds to Via the following definitions:
Which is caused by a failing check. I also noticed the following results are not checked in that test: rclc/rclc_lifecycle/test/test_lifecycle.cpp Lines 103 to 125 in fe5b792 So, I suspect it might be something wrong with one of those objects, which causes the creation of the next item to fail. EDIT: After having thought about this some more, I find my explanation partially unlikely, as the test have correctly finished since the lifecycle event patch. |
|
@SuperJappie08 can you take a look at #444? i think Xpr jobs are expected to fail because it dose not align with current source code. |
|
at least, full source code build and tests are all green. #442 (comment) |
Description
this PR addresses 2 issues.
rclcpp::spin_some(Node::SharedPtr)is deprecated in favor of using an executor directly. see https://ci.ros2.org/job/ci_linux-aarch64/20707/clang-tidy/rclcpp::init()was called andrclcpp::init()was being called unconditionally, causing issues when running multiple tests.Fixes # (issue)
Is this user-facing behavior change?
No
Did you use Generative AI?
Copilot Claude Sonnet 4.5
Additional Information