diff options
| author | christos <christos@NetBSD.org> | 2019-01-13 15:36:57 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2019-01-13 15:36:57 +0000 |
| commit | ebe920276decb63df7cef0462573163ca7348113 (patch) | |
| tree | 6d6390801b0bf47a47cd0d23fd638ac8ccdef7a2 /tests/kernel | |
| parent | 200c256b37decc8a9769b6b9bdb85d1df1e7031e (diff) | |
Increase the timeout a bit, and make sure we join so that there is no
race.
Diffstat (limited to 'tests/kernel')
| -rw-r--r-- | tests/kernel/t_timeleft.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/kernel/t_timeleft.c b/tests/kernel/t_timeleft.c index edc22674c58..336637c5b82 100644 --- a/tests/kernel/t_timeleft.c +++ b/tests/kernel/t_timeleft.c @@ -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 @@ static void 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 @@ tester(void (*fun)(struct timespec *)) 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, <)); |
