Conversation
|
You'll have to use spin or spin_once to test what I'm talking about. Spin some will result in a non-blocking spin, so timers could be handled when rmw_wait wakes up. You need a blocking call to rmw_wait or a timed call to rmw_wait in order to test what I was describing. That's why I suggested calling spin in a thread so it can block. |
|
I have added the test you described in 51d1565988c26fc718b2d3de0e21ca2aa1497e4b. http://ci.ros2.org/job/ros2_batch_ci_linux/134/ |
test_rclcpp/test/test_timer.cpp
Outdated
There was a problem hiding this comment.
Using the mechanism you're testing in order to shutdown the test is not a reliable way to make sure the test stops. In fact if this test fails as I expect it to, this callback will not be executed, the test will hang, and the test runner will have to kill it.
|
lgtm, thanks for iterating on it. |
|
With the increased timeout (9c2114d96ba6893dcf3b4180ea6d085fa6bd6c38) the tests pass: I have also created ament/ament_cmake#19 to better handle this case. |
http://ci.ros2.org/job/ros2_batch_ci_linux/133/
http://ci.ros2.org/job/ros2_batch_ci_osx/65/
http://ci.ros2.org/job/ros2_batch_ci_windows/92/