Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/kernel Increase the timeout a bit, and make sure we jo...



details:   https://anonhg.NetBSD.org/src/rev/a35222e1aaa8
branches:  trunk
changeset: 447493:a35222e1aaa8
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 13 15:36:57 2019 +0000

description:
Increase the timeout a bit, and make sure we join so that there is no
race.

diffstat:

 tests/kernel/t_timeleft.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r d68458718001 -r a35222e1aaa8 tests/kernel/t_timeleft.c
--- a/tests/kernel/t_timeleft.c Sun Jan 13 14:35:00 2019 +0000
+++ b/tests/kernel/t_timeleft.c Sun Jan 13 15:36:57 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_timeleft.c,v 1.2 2017/12/30 17:06:27 martin Exp $ */
+/* $NetBSD: t_timeleft.c,v 1.3 2019/01/13 15:36:57 christos Exp $ */
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_timeleft.c,v 1.2 2017/12/30 17:06:27 martin Exp $");
+__RCSID("$NetBSD: t_timeleft.c,v 1.3 2019/01/13 15:36:57 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/select.h>
@@ -84,7 +84,7 @@
 tester(void (*fun)(struct timespec *))
 {
        const struct timespec ts = { 5, 0 };
-       const struct timespec sts = { 0, 2000000 };
+       const struct timespec sts = { 1, 0 };
        struct info i = { fun, ts };
        pthread_t thr;
 
@@ -93,6 +93,7 @@
 
        nanosleep(&sts, NULL);
        pthread_kill(thr, SIGINT);
+       pthread_join(thr, NULL);
        printf("Orig time %ju.%lu\n", (intmax_t)ts.tv_sec, ts.tv_nsec);
        printf("Time left %ju.%lu\n", (intmax_t)i.ts.tv_sec, i.ts.tv_nsec);
        ATF_REQUIRE(timespeccmp(&i.ts, &ts, <));



Home | Main Index | Thread Index | Old Index