[LTP] [PATCH] openposix: sem_timedwait: replace sleep with tst_process_state_wait3
Jan Stancek
jstancek@redhat.com
Fri Feb 28 13:25:24 CET 2025
On Thu, Feb 27, 2025 at 2:39 PM Petr Vorel <pvorel@suse.cz> wrote:
>
> Hi Jan,
>
> > This makes the test faster and also avoids a small race - when the
> > time is very close to starting new second, this makes the test use
> > timeout that's effectively just slightly over one second, because
> > nanosecond portion is always set to 0. And previously child would
> > sleep roughly one second.
>
> LGTM.
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
Thanks, pushed.
>
> I also wonder if other tests with sleep(1) are relevant. e.g.
>
> conformance/interfaces/pthread_rwlock_timedrdlock/6-2.c
> conformance/interfaces/pthread_rwlock_timedwrlock/6-2.c
>
> (There are more sleep() uses, but I suppose others aren't relevant.)
I suspect there are still many testcases where sleep() could be replaced.
>
> Also, some tests (e.g conformance/interfaces/clock_nanosleep/1-3.c updated few
> years ago) did not updated sleep() in docs comment.
>
> Kind regards,
> Petr
>
More information about the ltp
mailing list