[LTP] [PATCH v2] clock_settime: Detect external clock adjustments via CLOCK_MONOTONIC
Petr Vorel
pvorel@suse.cz
Wed Apr 29 09:50:29 CEST 2026
> Hi!
> > These tests manipulate CLOCK_REALTIME to verify timer and
> > clock_nanosleep behavior, but NTP or VM time sync can also adjust
> > CLOCK_REALTIME during the test, causing timers to fire at wrong times
> > and producing spurious failures.
> > Use CLOCK_MONOTONIC as a sideband check to detect external interference.
> > If the monotonic elapsed time is anomalous, report UNTESTED instead of
> > a false FAIL. Guard the checks with _POSIX_MONOTONIC_CLOCK since
> > CLOCK_MONOTONIC is optional in POSIX.1-2001.
> Maybe we can retry a few times before we give up and report untested?
+1.
Kind regards,
Petr
More information about the ltp
mailing list