zephyr/tests
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
..
application_development device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
arch tests: x86: pagetables: fix non-KPTI case 2020-10-26 08:56:47 -04:00
benchmarks tests: initializing rbtree and its node 2020-10-21 10:06:42 -04:00
bluetooth tests: Bluetooth: bsim: Extended scanning with duration 2020-10-21 12:44:38 +02:00
boards device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
crypto ztest: remove ztest_mem_domain 2020-08-26 20:35:02 -04:00
deprecated/inttype dts: remove legacy macro support 2020-10-09 08:45:38 -05:00
drivers tests: drivers: regulator: add test for fixed regulator 2020-10-28 15:22:53 +01:00
kernel tests/kernel/schedule_api: Fix slop in timeslice test 2020-10-29 07:39:39 -04:00
lib lib/os/heap: Correct aligned_alloc sizing for small heaps 2020-10-23 12:52:04 -04:00
misc/test_build sanitycheck: inclusive language 2020-08-27 07:04:07 -04:00
net net: shell: Add network mgmt events monitor support 2020-10-13 13:42:50 +03:00
portability tests: cmsis_rtos_v2: Fix stack overflow 2020-10-13 20:04:31 +02:00
posix tests: posix/{common,fs}: enable testing TLS 2020-10-24 10:52:00 -07:00
shell tests: shell: Add test for too many arguments in the command 2020-09-14 16:05:11 +02:00
subsys boards: arm: remove non-existing doc link from partition definitions 2020-10-27 15:01:19 -04:00
unit testsuite: fix unittest cross-language flags 2020-08-31 11:02:35 -04:00
ztest tests/samples: enable for integration testing 2020-07-30 08:00:03 -04:00