-
Notifications
You must be signed in to change notification settings - Fork 7.4k
tests/kernel: fifo_timeout: Remove wake-up order checking #10047
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
Conversation
@@ -1,2 +1,3 @@ | |||
CONFIG_ZTEST=y | |||
CONFIG_IRQ_OFFLOAD=y | |||
CONFIG_BOOT_DELAY=1000 |
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.
@rgundi: Is there any reason for introducing boot delay?
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.
Yes. The issue #8159 cannot be reproduced without this delay. It's a very timing dependent issue.
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.
you should remove it though, we do not set this for tests by default.
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.
I think that this PR throws out the baby with the bathwater, as it removes order check completely.
IMHO order check should be still there, but it has to take under account presence of tick granulation. For example we can record start time of each thread and check if the timeouts are in specified bounds (not earlier than _ms_to_ticks() and not later than _ms_to_ticks()+1).
I can't see a better method as the timeouts get affected by system loading. If the interrupts get locked for whatever reason, the timeouts may go out of bounds (later than _ms_to_ticks()+1). So, all we can do is to ensure the timeouts do not happen earlier than _ms_to_ticks(). |
@pizi-nordic .. can you please comment? |
I agree that there is no upper limit on loaded system.
|
ae6cea5
to
b02a01f
Compare
@pizi-nordic Agree. Have updated the test. Please check. |
Codecov Report
@@ Coverage Diff @@
## master #10047 +/- ##
=======================================
Coverage 53.05% 53.05%
=======================================
Files 214 214
Lines 26203 26203
Branches 5646 5646
=======================================
Hits 13903 13903
Misses 10028 10028
Partials 2272 2272 Continue to review full report at Codecov.
|
} | ||
} | ||
|
||
if (data->timeout > test_data[j].timeout) { |
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.
IMHO this check is not the one we want.
Whit this code, kernel might wake-up thread earlier than expected and the test will not notice that.
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.
That is already taken care in "is_timeout_in_range()" function. That function checks for the lower limit while the new code above checks for the upper limit.
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.
Ok
@@ -1,2 +1,3 @@ | |||
CONFIG_ZTEST=y | |||
CONFIG_IRQ_OFFLOAD=y | |||
CONFIG_BOOT_DELAY=1000 |
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.
you should remove it though, we do not set this for tests by default.
There is no guarantee of wake-up order when multiple threads are woken up on the same tick. Hence, modified the tests accordingly. Fixes zephyrproject-rtos#8159. Signed-off-by: Rajavardhan Gundi <[email protected]>
@nashif : Done. |
There is no guarantee of wake-up order when multiple threads
are woken up on the same tick. Hence, modified the tests
accordingly.
Fixes #8159.
Signed-off-by: Rajavardhan Gundi [email protected]