zephyr/tests/kernel
Andy Ross 0875740a34 tests/kernel/schedule_api: Fix slop in timeslice test
This test is a little subtle: it wants to spawn three threads to run
and be switched out by a timeslice interrupt.  And it wants to consume
half a time slice itself before it starts running.  And, because
timeslicing runs out of the same tick framework in the timer driver,
it needs to align to the start of a tick before the process starts.
And further: it does its own time math not in ticks but in timer
cycles, so it's quite sensitive to slop.

But it's "synchronize to tick boundary" code was actually
synchronizing to a CYCLE boundary, which is just wrong.  And it was
doing this in the wrong order.  It was resetting the timeslice first
and then synchronizing to a tick by spinning, which means that the
test was always going to begin as much as a tick late.  Do the tick
synchronization (via a sleep) first.

Finally, the manager thread that was spawning the new threads lives at
the same priority as the highest priority child threads, which means
it can potentitially wake up on the semaphores that they are giving in
the middle of the test and consume CPU unexpectedly.  Make sure it's
sleeping for the duration.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-10-29 07:39:39 -04:00
..
common test: atomic operation : add code description 2020-10-27 09:14:08 -04:00
context tests/kernel/context: Update for cavs_timer 2020-10-21 06:38:53 -04:00
device tests: device: update test case 2020-10-02 11:38:30 +02:00
early_sleep device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
fatal tests: exception: workaround agressive optimization 2020-10-06 11:41:23 -04:00
fifo kernel/poll: Mark incompatibility with KERNEL_COHERENCE 2020-10-21 06:38:53 -04:00
fpu_sharing tests: Apply dynamic IRQ API change 2020-09-02 13:48:13 +02:00
gen_isr_table boards: cc1352r_sensortag: add support for TI CC1352R SensorTag 2020-10-08 16:08:36 -04:00
interrupt tests: Apply dynamic IRQ API change 2020-09-02 13:48:13 +02:00
lifo tests: Apply IRQ offload API change 2020-09-02 13:48:13 +02:00
mbox tests: mailbox: add new tests 2020-09-16 12:13:05 -04:00
mem_heap/mheap_api_concept tests: copyright message add year to the existing 2020-08-06 07:31:46 -04:00
mem_pool tests: Apply IRQ offload API change 2020-09-02 13:48:13 +02:00
mem_protect tests: sys_sem: add k_thread_join() calls 2020-10-28 10:29:49 -07:00
mem_slab tests: mem protection tests updated tags 2020-08-06 07:31:46 -04:00
mp tests/samples: add tags to some tests 2020-07-20 17:44:16 -04:00
msgq/msgq_api tests: Apply IRQ offload API change 2020-09-02 13:48:13 +02:00
mutex tests: sys_mutex: don't add to default domain 2020-10-22 16:47:07 -07:00
obj_tracing tests: kernel: remove ram restrictions 2020-06-09 23:36:16 -04:00
pending tests: kernel: remove ram restrictions 2020-06-09 23:36:16 -04:00
pipe Test: Refine annotaion and testcase for pipe. 2020-10-27 09:05:47 -04:00
poll Test: Refine annotaion and testcase for poll. 2020-10-27 09:06:35 -04:00
profiling/profiling_api tests: explicitly disable HW Stack Protection when needed 2020-09-24 15:42:09 -05:00
queue kernel/poll: Mark incompatibility with KERNEL_COHERENCE 2020-10-21 06:38:53 -04:00
sched tests/kernel/schedule_api: Fix slop in timeslice test 2020-10-29 07:39:39 -04:00
semaphore/semaphore tests: Apply IRQ offload API change 2020-09-02 13:48:13 +02:00
sleep tests: kernel/sleep: increase maximum threshold for nRF51 2020-09-24 09:52:32 -05:00
smp tests: smp: improving the description for SMP test cases 2020-10-04 14:26:31 -07:00
spinlock tests: spinlock: fix occasional crash 2020-09-03 21:55:05 +02:00
stack/stack tests: kernel: stack: fix for memcmp with wrong length 2020-09-16 12:03:32 +02:00
threads tests: add a simple test for thread local storage 2020-10-24 10:52:00 -07:00
tickless tests: kernel: tickless: re-enabled test-suite for Qemu Cortex-M0 2020-06-24 18:04:17 -07:00
timer tests: kernel: timer_api: align tick for duration period test 2020-10-22 06:18:14 -04:00
workq kernel/poll: Mark incompatibility with KERNEL_COHERENCE 2020-10-21 06:38:53 -04:00
xip tests: xip: remove hack and add qemu_x86_xip 2020-07-30 12:25:37 +02:00