zephyr/tests/kernel/queue/src
Andrew Boie 12b76253f6 tests: queue: fix SMP issue
test_queue_supv_to_user() invokes a child thread which does some
work which must take place before the call to k_queue_cancel_wait()
is called by the parent.

However, with SMP enabled, the child thread will just run on another
CPU and we have a race between when child_thread_get() calls
k_queue_get(q, K_FOREVER) and the parent calls k_queue_cancel_wait().
If the parent thread gets there first, the whole test hangs as
the call to k_queue_get(q, K_FOREVER) sits forever.

The fix is to have test_queue_supv_to_user() be a 1cpu test, which
ensures that only one CPU is used.

It's not clear to me why this wasn't causing CI failures on other
SMP targets, but I am able to reproduce reliably on qemu_x86_64
with my user mode patches applied.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-18 11:17:33 -08:00
..
main.c tests: queue: fix SMP issue 2019-12-18 11:17:33 -08:00
test_queue_contexts.c coccinelle: standardize k_thread create/define calls with integer timeouts 2019-10-09 08:38:10 -04:00
test_queue_fail.c global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
test_queue_loop.c coccinelle: standardize k_thread create/define calls with integer timeouts 2019-10-09 08:38:10 -04:00
test_queue_user.c coccinelle: standardize k_thread create/define calls with integer timeouts 2019-10-09 08:38:10 -04:00
test_queue.h tests: queue: test k_queue_alloc_*pend() 2019-06-18 09:08:01 -04:00