-
Notifications
You must be signed in to change notification settings - Fork 914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add time when timer expired to timer events #1130
Conversation
Adjusted the test to compare the expected time to when the timer expired (callback added to the queue) instead of when the callback is actually called... Instead of adding a new |
I went ahead and merged #1132 for now since it addresses the problem by only changing the test. If you think the changes in this patch are still useful we can keep this PR open. Currently the patch is ABI-incompatible since it e.g. inserts new arguments before existing ones. |
When the a timer expires, the callback is added to the queue. So the callback is then then poped from the queue at some later point (for which the time is recored as current_real in the timer event). This adds the time of when the timer actually expired to the timer event info, in the hope that this will make debugging easier and provide a better base to test the timers.
Instead of checking when the callback was actually called, check for when the timer expired (the callback was added to the callback queue) using the new current_expired time. This *should* make the test more reliable.
Some numbers running this on my i5 laptop with As somewhat expected the main source of the time difference is not that the timer expired too late, but that the callback is popped too late from the queue. In the late cases the time difference between timer expiration (callback gets added to queue) and when the callback is actually called is almost always over 0.1s.
|
I would say that is expected behavior on a non-realtime kernel. Since the patch still changes the API I would think it shouldn't be merged into already released distros. Therefore I would suggest to merge it for ROS M-turtle. |
@ros-pull-request-builder retest this please |
When the a timer expires, the callback is added to the queue.
So the callback is then then popped from the queue at some later point (for which the time is recored as current_real in the timer event).
This adds the time of when the timer actually expired to the timer event info,
in the hope that this will make debugging easier and provide a better base to test the timers.
I'm not really sure if it would be ok to add something to the timer events...
This is mainly meant as a base for discussion (see #1120 and #1129) and the possibility to test if the timer test can be improved using the
current_expired
time instead ofcurrent_real
.