summaryrefslogtreecommitdiff
path: root/tests/modules
diff options
context:
space:
mode:
authorkamil <kamil@NetBSD.org>2019-04-04 10:53:20 +0000
committerkamil <kamil@NetBSD.org>2019-04-04 10:53:20 +0000
commitb0befe47ff613b0f742d520053f6dcdc8259af56 (patch)
treea3f55209d058521f177f48263b2a4b538e02b9ce /tests/modules
parentc0eef093647318c82bfdb7db0058a3d2875d32e7 (diff)
Fix flaky check for the /dev/kcov device in t_kcov
Add a top-level check for the KCOV device, instead of deferring it ot each thread. The thread-based solution was flaky. PR kern/54064 by Andreas Gustafsson
Diffstat (limited to 'tests/modules')
-rw-r--r--tests/modules/t_kcov.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/modules/t_kcov.c b/tests/modules/t_kcov.c
index ca4f1ee88d2..b458e7b5f23 100644
--- a/tests/modules/t_kcov.c
+++ b/tests/modules/t_kcov.c
@@ -514,6 +514,14 @@ kcov_multiple_threads(size_t N)
{
pthread_t thread[32];
size_t i;
+ int fd;
+
+ /*
+ * Check if /dev/kcov is available, if not bail out.
+ * Verifying it on a per-thread basis is flaky.
+ */
+ fd = open_kcov();
+ ATF_REQUIRE(close(fd) == 0);
ATF_REQUIRE(__arraycount(thread) >= N);