fix(gpio_controllers): resolve build race condition in tests#2128
fix(gpio_controllers): resolve build race condition in tests#2128Ishan1923 wants to merge 5 commits intoros-controls:masterfrom
Conversation
Signed-off-by: Ishan1923 <ecdev4ishan@gmail.com>
gpio_controllers/CMakeLists.txt
Outdated
| controller_manager::controller_manager | ||
| hardware_interface::hardware_interface | ||
| ros2_control_test_assets::ros2_control_test_assets | ||
| ${PROJECT_NAME} |
There was a problem hiding this comment.
| ${PROJECT_NAME} | |
| gpio_controllers |
Let's change it to the name of the library for now, to have consistency with other controllers.
I agree it is better with ${PROJECT_NAME} though
There was a problem hiding this comment.
Ok i will just do this instead
change: ${PROJECT_NAME} -> gpio_controllers
Signed-off-by: Ishan1923 <ecdev4ishan@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2128 +/- ##
=======================================
Coverage 84.76% 84.76%
=======================================
Files 151 151
Lines 14619 14619
Branches 1269 1269
=======================================
Hits 12392 12392
Misses 1767 1767
Partials 460 460
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
christophfroehlich
left a comment
There was a problem hiding this comment.
We never link against the library itself (aka the controller plugins) in test_load_* tests of other controllers. Why should this be necessary here?
|
Maybe |
I agree. I also thought the same at first and then I verified other controllers and there we are linking too. Not sure why |
In which ones are we linking against? I only had a look in a few.. |
ros2_controllers/joint_state_broadcaster/CMakeLists.txt Lines 58 to 66 in 9817475 ros2_controllers/joint_trajectory_controller/CMakeLists.txt Lines 96 to 103 in 9817475 ros2_controllers/position_controllers/CMakeLists.txt Lines 42 to 49 in 9817475 There might be few more with the linking, I didn't go through all of them. I saw few without too, but I agree that it shouldn't be linked. |
|
@christophfroehlich Thanks for the clarification! The reason I added the link is to resolve a build race condition: this test includes headers generated by Since we prefer not to link the plugin library directly, I can replace add_dependencies(test_load_gpio_command_controller gpio_controllers)what should I do? |
No this is not correct, it does not use any package-related headers (or library) at compile time. It only loads the plugin at test-time.
Have you tried to remove the |
Signed-off-by: Ishan1923 <ecdev4ishan@gmail.com>
|
This was overlooked by me. The headers included via this: target_include_directories(test_load_gpio_command_controller PRIVATE include)is not required at the compile time, but in the runtime; for this pluginlib will handle it. It was extra-safety line which was not needed, as it was creating unnecessary compile time dependency. |
gpio_controllers/CMakeLists.txt
Outdated
| controller_manager::controller_manager | ||
| hardware_interface::hardware_interface | ||
| ros2_control_test_assets::ros2_control_test_assets | ||
| gpio_controllers |
There was a problem hiding this comment.
this is not needed now, right?
| gpio_controllers |
Signed-off-by: Ishan1923 <ecdev4ishan@gmail.com>
|
I have removed gpio_controllers. |
This PR fixes the build failure reported in #2117.
Changes:
Added
${PROJECT_NAME}totarget_link_librariesfor thetest_load_gpio_command_controllertarget. This ensures the parameter headers are generated before the test is compiled.Fixes #2117