tests: sleep: Increase tick margin for Xilinx QEMU

The Xilinx QEMU, used to emulate the Xilinx ZynqMP platform, is
particularly unstable in terms of timing.

This commit increases the tick margin for the Xilinx ZynqMP platform
from 1 to 5 in order to allow the sleep test to pass with a reasonable
repeatability.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
Stephanos Ioannidis 2020-02-10 12:39:10 +09:00 committed by Andrew Boie
commit 620f55428d

View file

@ -24,7 +24,16 @@
#define ONE_SECOND_ALIGNED \
(u32_t)(k_ticks_to_ms_floor64(k_ms_to_ticks_ceil32(ONE_SECOND) + _TICK_ALIGN))
#if defined(CONFIG_SOC_XILINX_ZYNQMP)
/*
* The Xilinx QEMU, used to emulate the Xilinx ZynqMP platform, is particularly
* unstable in terms of timing. The tick margin of at least 5 is necessary to
* allow this test to pass with a reasonable repeatability.
*/
#define TICK_MARGIN 5
#else
#define TICK_MARGIN 1
#endif
static struct k_sem test_thread_sem;
static struct k_sem helper_thread_sem;