tests: context: allow 2 ticks of slop
The hard-coded value of 10ms doesn't take the system configured amount of ticks per second, nor does it account for an unlucky tick advance which causes the test to fail very intermittently in QEMU. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
7a5150cd9f
commit
68e8813896
1 changed files with 1 additions and 1 deletions
|
@ -694,7 +694,7 @@ static void test_thread_sleep(void *delta, void *arg2, void *arg3)
|
|||
timestamp = k_uptime_get() - timestamp;
|
||||
TC_PRINT(" thread back from sleep\n");
|
||||
|
||||
if (timestamp < timeout || timestamp > timeout + 10) {
|
||||
if (timestamp < timeout || timestamp > timeout + __ticks_to_ms(2)) {
|
||||
TC_ERROR("timestamp out of range, got %d\n", (int)timestamp);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue