Source-Changes-HG archive

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

[src/trunk]: src/tests/modules Fix flaky check for the /dev/kcov device in t_...



details:   https://anonhg.NetBSD.org/src/rev/a56340e44eeb
branches:  trunk
changeset: 997976:a56340e44eeb
user:      kamil <kamil%NetBSD.org@localhost>
date:      Thu Apr 04 10:53:20 2019 +0000

description:
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:

 tests/modules/t_kcov.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (18 lines):

diff -r acbe13277be2 -r a56340e44eeb tests/modules/t_kcov.c
--- a/tests/modules/t_kcov.c    Thu Apr 04 08:16:24 2019 +0000
+++ b/tests/modules/t_kcov.c    Thu Apr 04 10:53:20 2019 +0000
@@ -514,6 +514,14 @@
 {
        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);
 



Home | Main Index | Thread Index | Old Index