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 <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2022-01-14 16:23:03 +01:00 committed by Anas Nashif
commit fe423d52a7

View file

@ -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);