Skip to content
Commit b6527799 authored by Andy Ross's avatar Andy Ross Committed by Carles Cufí
Browse files

tests/kernel/context: Fixup slop in cpu_idle test case



This test was written to idle for exactly 1ms and wake up with zero
error, which is just too tight for some platforms (and worked on
emulators where the tick rate is 10x coarser only because 0 == 0!).

And it's not clear that it's testing anything we promise in
documentation, regardless.  Early wakeups are not an error and
absolutely not disallowed, yet the test is treating the wakeup like a
sleep.

Clean it up a bit and relax the tolerance to what we can compute
reliably: do all the math in ticks, idle for 10ms (i.e. longer than a
host quantum for emulators), and allow 1 tick of slop on either side to
permit slightly early wakeups while still verifying that "yes, the idle
did idle".

Fixes #46641

Signed-off-by: default avatarAndy Ross <andyross@google.com>
parent 824ccc00
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment