Skip to content

Commit

Permalink
tests: work_queue: wait longer for expired triggering items
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dcpleung authored and MaureenHelm committed Oct 5, 2020
1 parent 6f0c8f0 commit 1cd545d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/kernel/workq/work_queue/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 1cd545d

Please sign in to comment.