[LTP] [PATCH] openposix: sem_timedwait: replace sleep with tst_process_state_wait3

Petr Vorel pvorel@suse.cz
Thu Feb 27 14:38:51 CET 2025


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>

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.)

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