From 1f4a8945d117f1f557964f8fc652f95c552b4ab0 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Mon, 5 Dec 2022 14:21:37 +0100 Subject: [PATCH] test/unit: Add verbose opt to valgrind and unset DEBUGINFOD_* It looks like fedora intentionally sets $DEBUGINFOD_URLS inside the environment as per the contents of /etc/debuginfod/. When set, valgrind uses this URL list to fetch extra debuginfo from the target servers. This is an unwanted behavior, since depending on the net state it may block the tests leading to job timeouts under CI. To mitigate, unset all DEBUGINFOD_* vars while running valgrind. Also, enable verbose output to make sure we are aware what valgrind is actually doing under the hood (e.g. info about fetching debuginfo could not be seen without it). Fixes issue #2767 Signed-off-by: Michal Berger Change-Id: If7c3bf341bd78c1cb9a68c5f86379fd7d3682f4e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15774 Reviewed-by: Konrad Sztyber Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- test/common/autotest_common.sh | 3 +++ test/unit/unittest.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index f4440e01c..07480a235 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -251,6 +251,9 @@ export AR_TOOL=$rootdir/scripts/ar-xnvme-fixer # pass our valgrind desire on to unittest.sh if [ $SPDK_RUN_VALGRIND -eq 0 ]; then export valgrind='' +else + # unset all DEBUGINFOD_* vars that may affect our valgrind instance + unset -v "${!DEBUGINFOD_@}" fi if [ "$(uname -s)" = "Linux" ]; then diff --git a/test/unit/unittest.sh b/test/unit/unittest.sh index 9609b24f0..ed7609308 100755 --- a/test/unit/unittest.sh +++ b/test/unit/unittest.sh @@ -152,7 +152,7 @@ fi # the env variable to override the default shown below. if [ -z ${valgrind+x} ]; then if grep -q '#undef SPDK_CONFIG_ASAN' $rootdir/include/spdk/config.h && hash valgrind; then - valgrind='valgrind --leak-check=full --error-exitcode=2' + valgrind='valgrind --leak-check=full --error-exitcode=2 --verbose' else valgrind='' fi