From 1cd545d5ae4ef174d62972753a281cbe89f328c5 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 23 Sep 2020 14:37:50 -0700 Subject: [PATCH] tests: work_queue: wait longer for expired triggering items The test_triggered_wait_expired test submits the items with 2*SUBMIT_WAIT timeout and waits for the timeout to expire so the items are being worked on. It waits one SUBMIT_WAIT and checks none of the items have started. Then waits another SUBMIT_WAIT to check if they have all finished. However, since the timeout is at 2*SUBMIT_WAIT, the work queue may have just started going through the list of items. This means some items may have started while others have not. This results in the test failing as not all items have finished. So lengthen the second sleep to allow items to finish before checking. Fixes #28589 Signed-off-by: Daniel Leung --- tests/kernel/workq/work_queue/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kernel/workq/work_queue/src/main.c b/tests/kernel/workq/work_queue/src/main.c index f55bf965e02d..6ff4fe93f3b9 100644 --- a/tests/kernel/workq/work_queue/src/main.c +++ b/tests/kernel/workq/work_queue/src/main.c @@ -771,7 +771,7 @@ static void test_triggered_wait_expired(void) check_results(0); /* Items should be executed when we will be sleeping here. */ - k_msleep(SUBMIT_WAIT); + k_msleep(SUBMIT_WAIT * 2); TC_PRINT(" - Checking results (after timeout)\n"); check_results(NUM_TEST_ITEMS);