test: remove unnecessary sleep in waitable test#3111
test: remove unnecessary sleep in waitable test#3111Anusha-Sharma-2 wants to merge 2 commits intoros2:rollingfrom
Conversation
Signed-off-by: Anusha Sharma <anushasharma.wa@gmail.com>
|
It looks like the build is failing due to a missing symbol ( I encountered the same error locally, so I’m wondering if this might be due to a version mismatch between Since this PR only modifies a test file, I don’t expect it to affect compilation. Happy to investigate further or adjust if needed. |
| // not be there, or test cases where that is important should use the | ||
| // on_execute_callback? | ||
| std::this_thread::sleep_for(3ms); | ||
| // Removed unnecessary sleep based on TODO comment; tests should rely on explicit synchronization instead |
There was a problem hiding this comment.
then why do we not remove the else statement?
| // TODO(wjwwood): I don't know why this was here, but probably it should | ||
| // not be there, or test cases where that is important should use the | ||
| // on_execute_callback? | ||
| std::this_thread::sleep_for(3ms); |
There was a problem hiding this comment.
do you have any rational reason that we can remove this sleep instead of being said by this comment? the comment here looks pretty old, and code base could be really different as it grows. i do not think relying only on the comment would be good enough to modify and change the behavior?
Signed-off-by: Anusha Sharma <anushasharma.wa@gmail.com>
d4074c4 to
2715400
Compare
|
Thanks for pointing that out! I’ve updated the implementation to remove the Regarding the
In If the sleep was originally introduced to mitigate a timing or race-related issue, it might be worth identifying and documenting that explicitly rather than relying on an unconditional delay, and I'd love to help identify that. That said, I may be missing some historical context here, so I’m happy to keep or adjust the approach if this sleep is still required for test stability. |
Description
Removes an unnecessary sleep from
test_waitable.cpp.The test contained a TODO comment questioning the purpose of a
std::this_thread::sleep_for(3ms)call. The sleep has been removed to simplify the test and avoid unnecessary delays.Is this user-facing behavior change?
No.
Did you use Generative AI?
No.
Additional Information
This change is limited to test code and should not affect runtime behavior.
Note: A local build was attempted but failed due to a version mismatch between the rclcpp source and the installed ROS rolling binaries. CI should validate this change in the correct environment.