-
Notifications
You must be signed in to change notification settings - Fork 7.6k
tests: lib: timespec_util: support tick period not multiples of 100ms #92255
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
tests: lib: timespec_util: support tick period not multiples of 100ms #92255
Conversation
If the system tick period is not a multiple of 100ms, then K_MSEC(100) does not correspond exactly to 100000000 ns after going through tick conversion. Convert 100ms to ticks and then to ns to account for this within the testsuite. Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into a fix @cfriedt ,
But doesn't this problem apply to all values in this array in general?
The first column is a value in ticks. So it will have whatever resolution the tick has.
The bug report provided a reproduction with one particular platform in which the rounding was off for the 100ms value, but depending on CONFIG_SYS_CLOCK_TICKS_PER_SEC any other of this values may round out badly, or?
Meaning shouldn't this change be applied to all values here?
Sure, I can probably do the conversion within the macro to cover other cases. |
@cfriedt do you think you will have the time to do this change sometime soon? |
At least it fixes the issue happening for nordic devices.
@aescolar - I think I can probably make an improved version tomorrow with hopefully much better test cases defined. There were quite a few corner cases that I wanted to cover and also possibly some implementation improvements |
@aescolar - maybe it's fine to merge this one for now. tick rate / time domain problems always seem to have corner cases. For reference, my alternative is here |
Closing this in favour of #92709 |
If the system tick period is not a multiple of 100ms, then
K_MSEC(100)
does not correspond exactly to 100000000 ns after going through tick conversion.Convert 100ms to ticks and then to ns to account for this within the testsuite.
Fixes #92158
Testing Done: