Skip to content

Use wall clock for Waitable tests.#321

Closed
hidmic wants to merge 1 commit intomasterfrom
hidmic/fix_test_waitable
Closed

Use wall clock for Waitable tests.#321
hidmic wants to merge 1 commit intomasterfrom
hidmic/fix_test_waitable

Conversation

@hidmic
Copy link
Copy Markdown
Contributor

@hidmic hidmic commented Dec 13, 2018

This pull request attempts to fix failing Waitable tests as seen in https://ci.ros2.org/view/nightly/job/nightly_linux_release/1023/testReport/, https://ci.ros2.org/view/nightly/job/nightly_xenial_linux-aarch64_release/194/testReport/ and https://ci.ros2.org/view/nightly/job/nightly_xenial_linux_release/188/testReport/. I'm no longer able to reproduce the issue locally with this fix.

My current hypothesis as to what's going is that the original test hooks up the timer to the default Node clock, which is of RCL_ROS_TIME type i.e. clock as published on a well known topic. Because of this, the timer sets up a guard condition and waits for it to be triggered, but that never happens because for this test there's no clock topic being published in the first place.

As to why it only fails for Release builds, it has to do with time. Until an RCL_ROS_TIME type clock becomes active, it reports wall clock time. If the time it takes the code to reach the first rmw_wait call is long enough for the timer to expire, then it will not block because the first wait wakes up because of the /parameter_events subscription. If it's too fast, then the Executor will go into a second wait cycle from which it'll never wake up (because no one's going to trigger the timer's guard condition).

@tfoote tfoote added the in progress Actively being worked on (Kanban column) label Dec 13, 2018
@nuclearsandwich
Copy link
Copy Markdown
Member

nuclearsandwich commented Dec 13, 2018

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status
  • Linux Release Build Status
  • Linux Xenial Release Build Status

@dirk-thomas
Copy link
Copy Markdown
Member

dirk-thomas commented Dec 13, 2018

the default Node clock, which is of RCL_ROS_TIME type i.e. clock as published on a well known topic.

That is incorrect. See http://design.ros2.org/articles/clock_and_time.html#ros-time Until the use_sim_time parameter is enables ROS time is the same as system time.

If this patch actually fixes the problem then I would expect there is an underlying problem in ROS time which needs to be fixed (which would make this patch obsolete).

@hidmic
Copy link
Copy Markdown
Contributor Author

hidmic commented Dec 13, 2018

That is incorrect. See http://design.ros2.org/articles/clock_and_time.html#ros-time Until the use_sim_time parameter is enables ROS time is the same as system time.

I see. I did not recall that design document, so I wrongly inferred RCL_ROS_TIME behavior from code. In any case, then the deeper problem is that the guard condition for a timer that's hooked to an RCL_ROS_TIME type clock is never triggered unless any of the rcl_*_ros_time_override functions are called, that in rclcpp are called from TimeSource. Meaning that waits are effectively broken for an inactive ROS time clock (assuming this is not intended behavior).

@hidmic
Copy link
Copy Markdown
Contributor Author

hidmic commented Dec 13, 2018

@sloretz
Copy link
Copy Markdown
Contributor

sloretz commented Dec 14, 2018

closing now that ros2/rcl#357 has been merged

@sloretz sloretz closed this Dec 14, 2018
@sloretz sloretz removed the in progress Actively being worked on (Kanban column) label Dec 14, 2018
@hidmic hidmic deleted the hidmic/fix_test_waitable branch April 22, 2019 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants