From 29b83584b01aaa7a0e883570e5c011110fc11a9c Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Mon, 1 Mar 2021 17:29:08 -0800 Subject: [PATCH] tests/p4wq: Fix impossible sleep interval The code here was written to "get out of the way just long enough for the trivial context switch and callback to execute". But on a machine with 50 kHz ticks, that's not reliably enough time and this was failing spuriously. Which would have been a reasonably forgivable mistake to make had I not written this code with this very machine in mind... Signed-off-by: Andy Ross --- tests/lib/p4workq/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/p4workq/src/main.c b/tests/lib/p4workq/src/main.c index 020eb520f06..4754450e0ed 100644 --- a/tests/lib/p4workq/src/main.c +++ b/tests/lib/p4workq/src/main.c @@ -260,7 +260,7 @@ static void test_p4wq_simple(void) k_p4wq_submit(&wq, &simple_item); zassert_false(has_run, "ran too early"); - k_sleep(K_TICKS(1)); + k_msleep(10); zassert_true(has_run, "low-priority item didn't run"); /* Higher priority, should preempt us */