Output the relevant time specs before the assertion, in the hopes of
authoranton <anton@openbsd.org>
Fri, 13 May 2022 15:32:49 +0000 (15:32 +0000)
committeranton <anton@openbsd.org>
Fri, 13 May 2022 15:32:49 +0000 (15:32 +0000)
figuring out why this occasionally fails.

regress/lib/libpthread/semaphore/sem_timedwait/sem_timedwait.c

index dc39cea..4693215 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sem_timedwait.c,v 1.4 2019/12/20 23:39:01 cheloha Exp $       */
+/*     $OpenBSD: sem_timedwait.c,v 1.5 2022/05/13 15:32:49 anton Exp $ */
 /*
  * Martin Pieuchot <mpi@openbsd.org>, 2011. Public Domain.
  */
@@ -98,6 +98,8 @@ main(int argc, char **argv)
        delay.tv_nsec = info.tick * 1000;       /* usecs -> nsecs */
        timespecadd(&delay, &delay, &delay);    /* up to two ticks of delay */
        timespecadd(&ts, &delay, &ts);
+       fprintf(stderr, "timeout: expected %lld.%09ld actual %lld.%09ld\n",
+           ts2.tv_sec, ts2.tv_nsec, ts.tv_sec, ts.tv_nsec);
        ASSERT(timespeccmp(&ts2, &ts, <=));
 
        CHECKe(sem_destroy(&sem));