tests/kernel/interrupt: Shrink very long k_busy_wait() argument

This test was written with an outrageously long timeout of 25 seconds.
That blows right through the 32 bit cycle counter on qemu_cortex_m3[1]
and produces an essentially random delay instead of the desired
number, causing a hang with the new SysTick driver in tickless mode.

Push the number down so it doesn't overflow.  The root cause, though,
is that k_busy_wait() can take arguments it can't handle.  It ought to
have an outer loop or something so that it can spin for INT_MAX
milliseconds correctly.

[1] Which has a 12MHz clock rate.  Many hardware implementations are
much faster still.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2018-10-12 09:57:43 -07:00 committed by Anas Nashif
commit ea35343eb1

View file

@ -83,7 +83,7 @@ static void offload_function(void *param)
zassert_true(_is_in_isr(), "Not in IRQ context!"); zassert_true(_is_in_isr(), "Not in IRQ context!");
k_timer_init(&timer, timer_handler, NULL); k_timer_init(&timer, timer_handler, NULL);
k_busy_wait(K_SECONDS(25)); k_busy_wait(K_SECONDS(1));
k_timer_start(&timer, DURATION, 0); k_timer_start(&timer, DURATION, 0);
zassert_not_equal(check_lock_new, check_lock_old, zassert_not_equal(check_lock_new, check_lock_old,
"Interrupt locking didn't work properly"); "Interrupt locking didn't work properly");