• Philippe Gerum's avatar
    testsuite/smokey: posix_clock: prevent false positive in time-dependent test · 99348f65
    Philippe Gerum authored
    clock_decrease_after_periodic_timer_first_tick checks that periodic
    interval timers based on CLOCK_REALTIME are not (pathologically)
    affected by the epoch going backwards.
    To this end, we measure the actual time observed between two ticks of
    a periodic timer based on CLOCK_REALTIME with a call to
    clock_settime() injecting a negative offset in between, equivalent to
    five ticks.
    Due to processing delays induced by clock_settime() and other latency,
    we could observe a duration which exceeds a tick by a few tenths of
    microseconds. Since we can't anticipate the amount of latency
    involved, let's accept a longer delay of at most two ticks.
    This is still correct from the standpoint of the test, which verifies
    that no correlation exists between the clock offset injected by
    clock_settime() and the delay until the next tick generated by the
    affected clock.
    Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
    Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
posix-clock.c 10.3 KB