From f26a4f893b8944160cf5d8c587f6ef6a65ffbda6 Mon Sep 17 00:00:00 2001 From: Steven Li Date: Sat, 10 Oct 2020 22:09:22 +0000 Subject: [PATCH] Added --helgrind support to crash_gen tool --- tests/pytest/crash_gen.sh | 14 ++++++++++++-- tests/pytest/crash_gen/crash_gen.py | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/pytest/crash_gen.sh b/tests/pytest/crash_gen.sh index bbd5d23108..23fb3f155a 100755 --- a/tests/pytest/crash_gen.sh +++ b/tests/pytest/crash_gen.sh @@ -42,6 +42,10 @@ TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep bin|head -n1` LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6|rev`/lib +# Now getting ready to execute Python +# The following is the default of our standard dev env (Ubuntu 20.04), modify/adjust at your own risk +PYTHON_EXEC=python3.8 + # First we need to set up a path for Python to find our own TAOS modules, so that "import" can work. export PYTHONPATH=$(pwd)/../../src/connector/python/linux/python3:$(pwd) @@ -57,9 +61,15 @@ if [[ $1 == '--valgrind' ]]; then valgrind \ --leak-check=yes \ --suppressions=crash_gen/valgrind_taos.supp \ - python3.8 \ + $PYTHON_EXEC \ + ./crash_gen/crash_gen.py $@ +elif [[ $1 == '--helgrind' ]]; then + shift + valgrind \ + --tool=helgrind \ + $PYTHON_EXEC \ ./crash_gen/crash_gen.py $@ else - python3.8 ./crash_gen/crash_gen.py $@ + $PYTHON_EXEC ./crash_gen/crash_gen.py $@ fi diff --git a/tests/pytest/crash_gen/crash_gen.py b/tests/pytest/crash_gen/crash_gen.py index e024eb7494..d15f264fb6 100755 --- a/tests/pytest/crash_gen/crash_gen.py +++ b/tests/pytest/crash_gen/crash_gen.py @@ -421,6 +421,7 @@ class ThreadCoordinator: errno2 = Helper.convertErrno(err.errno) # correct error scheme errMsg = "Transition failed: errno=0x{:X}, msg: {}".format(errno2, err) logger.info(errMsg) + traceback.print_exc() self._execStats.registerFailure(errMsg) # Then we move on to the next step -- GitLab