From fe423d52a71b3fe50c4d052c3ef03ec5702a9ac5 Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Fri, 14 Jan 2022 16:23:03 +0100 Subject: [PATCH] testsuite: ztress: Delay start of the test Delay start of threads and timer to ensure that setup is completed. Especially, vital on multiple CPUs. Signed-off-by: Krzysztof Chruscinski --- subsys/testsuite/ztest/src/ztress.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subsys/testsuite/ztest/src/ztress.c b/subsys/testsuite/ztest/src/ztress.c index 2829c12c166..4831cd2e880 100644 --- a/subsys/testsuite/ztest/src/ztress.c +++ b/subsys/testsuite/ztest/src/ztress.c @@ -353,16 +353,17 @@ int ztress_execute(struct ztress_context_data *timer_data, tids[i] = k_thread_create(&threads[i], stacks[i], CONFIG_ZTRESS_STACK_SIZE, ztress_thread, &thread_data[i], (void *)(uintptr_t)ztress_prio, NULL, - priority, 0, K_NO_WAIT); + priority, 0, K_MSEC(10)); (void)k_thread_name_set(tids[i], thread_names[i]); priority++; ztress_prio++; } if (timer_data != NULL) { - k_timer_start(&ztress_timer, backoff[0], K_NO_WAIT); + k_timer_start(&ztress_timer, K_MSEC(10), K_NO_WAIT); } + /* Wait until all threads complete. */ for (int i = 0; i < cnt; i++) { k_thread_join(tids[i], K_FOREVER);