Re: [PATCH] selftests: timers: Make sleep time in raw_skew configurable

From: Wake Liu

Date: Sun Jul 12 2026 - 22:07:40 EST


Thanks for the review :)
I've sent out v2 which addresses this by adding -h/--help support and
usage documentation.

On Fri, Jul 10, 2026 at 11:04 AM John Stultz <jstultz@xxxxxxxxxx> wrote:
>
> On Thu, Jul 9, 2026 at 7:51 PM Wake Liu <wakel@xxxxxxxxxx> wrote:
> >
> > The raw_skew test currently sleeps for 120 seconds to estimate clock
> > drift. This is a very long time for a single test, and can cause
> > timeouts in automated test suites or CI systems.
> >
>
> Sheesh, nobody has two minutes to spare? :)
>
> > Allow overriding the sleep time via a command line argument,
> > so it can be adjusted if needed in different environments, while
> > keeping the default at 120 seconds to preserve original behavior.
> >
> > Signed-off-by: Wake Liu <wakel@xxxxxxxxxx>
> > ---
> > tools/testing/selftests/timers/raw_skew.c | 13 +++++++++++--
> > 1 file changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/testing/selftests/timers/raw_skew.c b/tools/testing/selftests/timers/raw_skew.c
> > index a7bae7d80916..03cdcecba8f4 100644
> > --- a/tools/testing/selftests/timers/raw_skew.c
> > +++ b/tools/testing/selftests/timers/raw_skew.c
> > @@ -92,6 +92,15 @@ int main(int argc, char **argv)
> > struct timespec mon, raw, start, end;
> > long long delta1, delta2, interval, eppm, ppm;
> > struct timex tx1, tx2;
> > + int sleep_sec = 120;
> > +
> > + if (argc > 1) {
> > + sleep_sec = atoi(argv[1]);
> > + if (sleep_sec <= 0) {
> > + printf("Invalid sleep time, using default 120s\n");
> > + sleep_sec = 120;
> > + }
> > + }
>
> This probably needs some usage documentation so folks can discover this?
> (Which may mean also supporting -h/--help)
>
> Otherwise seems reasonable.
>
> thanks!
> -john



--
Best Regards,
Wake Liu