Skip to content

Commit

Permalink
test: only run valgrind tests if valgrind.h was found
Browse files Browse the repository at this point in the history
Disable t5000-valgrind.t by default when valgrind/valgrind.h was
not found by ./configure. This means that the valgrind hook to
disable dlclose() for modules is not active, and this has been found
to cause false positives for this test.

The test can still be forced by hand with the use of -d, --debug flag,
e.g.

 ./t5000-valgrind.t -d

Fixes flux-framework#1097
  • Loading branch information
grondo committed Jun 28, 2017
1 parent 48408d5 commit f292bf9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions t/t5000-valgrind.t
Expand Up @@ -11,6 +11,18 @@ if ! which valgrind >/dev/null; then
test_done
fi

# Do not run test by default unless valgrind/valgrind.h was found, since
# this has been known to introduce false positives (#1097). However, allow
# run to be forced on the cmdline with -d, --debug.
#
have_valgrind_h() {
grep -q "^#define HAVE_VALGRIND_VALGRIND_H" ${FLUX_BUILD_DIR}/config/config.h
}
if ! have_valgrind_h && test "$debug" = ""; then
skip_all='skipping valgrind tests b/c valgrind.h not found. Use -d, --debug to force'
test_done
fi

export FLUX_PMI_SINGLETON=1 # avoid finding leaks in slurm libpmi.so

VALGRIND=`which valgrind`
Expand Down

0 comments on commit f292bf9

Please sign in to comment.