From 093efa1117d677281f2d7605bec7dbefa9fa2c2c Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Thu, 25 Mar 2021 16:13:21 +0800 Subject: [PATCH 1/3] fix taosd deadlock in CI --- Jenkinsfile | 2 +- tests/test-all.sh | 28 +++++++++++++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e1bb27bf67..221bf5e490 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,7 +39,7 @@ def pre_test(){ sudo rmtaos || echo "taosd has not installed" ''' sh ''' - + ps -ef | grep taosd | grep -v grep | awk '{print $2}' | xargs kill -9 cd ${WKC} git checkout develop git reset --hard HEAD~10 >/dev/null diff --git a/tests/test-all.sh b/tests/test-all.sh index b8f06d8ede..17d42dafe5 100755 --- a/tests/test-all.sh +++ b/tests/test-all.sh @@ -29,7 +29,25 @@ function dohavecore(){ proc=`echo $corefile|cut -d "_" -f3` if [ -n "$corefile" ];then echo 'taosd or taos has generated core' - tar -zcPf $corepath'taos_'`date "+%Y_%m_%d_%H_%M_%S"`.tar.gz /usr/local/taos/ + if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]] && [[ $1 == 1 ]]; then + cd ../../../ + tar -zcPf $corepath'taos_'`date "+%Y_%m_%d_%H_%M_%S"`.tar.gz debug/build/bin/taosd debug/build/bin/tsim debug/build/lib/libtaos*so* + if [[ $2 == 1 ]];then + cp -r sim ~/sim_`date "+%Y_%m_%d_%H:%M:%S"` + rm -rf sim/case.log + else + cd community + cp -r sim ~/sim_`date "+%Y_%m_%d_%H:%M:%S" ` + rm -rf sim/case.log + fi + else + cd ../../ + if [[ $1 == 1 ]];then + tar -zcPf $corepath'taos_'`date "+%Y_%m_%d_%H_%M_%S"`.tar.gz debug/build/bin/taosd debug/build/bin/tsim debug/build/lib/libtaos*so* + cp -r sim ~/sim_`date "+%Y_%m_%d_%H:%M:%S" ` + rm -rf sim/case.log + fi + fi if [[ $1 == 1 ]];then echo '\n'|gdb /usr/local/taos/bin/$proc $core_file -ex "bt 10" -ex quit exit 8 @@ -100,14 +118,14 @@ function runSimCaseOneByOnefq { cp -r ../../sim ~/sim_`date "+%Y_%m_%d_%H:%M:%S" ` rm -rf ../../sim/case.log fi - dohavecore $2 + dohavecore $2 1 if [[ $2 == 1 ]];then exit 8 fi fi end_time=`date +%s` echo execution time of $case was `expr $end_time - $start_time`s. | tee -a out.log - dohavecore $2 + dohavecore $2 1 fi done rm -rf ../../../sim/case.log @@ -175,7 +193,7 @@ function runPyCaseOneByOnefq() { echo '=====================log===================== ' cat ../../sim/case.log rm -rf ../../sim/case.log - dohavecore $2 + dohavecore $2 2 if [[ $2 == 1 ]];then exit 8 fi @@ -184,7 +202,7 @@ function runPyCaseOneByOnefq() { else $line > /dev/null 2>&1 fi - dohavecore $2 + dohavecore $2 2 fi done rm -rf ../../sim/case.log From c10285f1a082185c4a3eee9fa5087baac8d6b582 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Thu, 25 Mar 2021 16:16:50 +0800 Subject: [PATCH 2/3] [TD-3443]fix taosd deadlock in CI --- Jenkinsfile | 2 +- tests/Jenkinsfile | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 221bf5e490..00bd7fff77 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,7 +39,7 @@ def pre_test(){ sudo rmtaos || echo "taosd has not installed" ''' sh ''' - ps -ef | grep taosd | grep -v grep | awk '{print $2}' | xargs kill -9 + ps -ef | grep taosd | grep -v grep | awk '{print $2}' | xargs kill -9 //avoid taosd deadlock cd ${WKC} git checkout develop git reset --hard HEAD~10 >/dev/null diff --git a/tests/Jenkinsfile b/tests/Jenkinsfile index 7cdcfb2e24..cba172c35b 100644 --- a/tests/Jenkinsfile +++ b/tests/Jenkinsfile @@ -56,14 +56,8 @@ pipeline { cd ${WKC}/tests ./test-all.sh b1 date''' - sh ''' - cd ${WKC}/tests - ./test-all.sh full jdbc - date''' - sh ''' - cd ${WKC}/tests - ./test-all.sh full unit - date''' + + } } @@ -136,6 +130,10 @@ pipeline { ./test-all.sh b2 date ''' + sh ''' + cd ${WKC}/tests + ./test-all.sh full unit + date''' } } @@ -154,6 +152,10 @@ pipeline { ''' } sh ''' + cd ${WKC}/tests + ./test-all.sh full jdbc + date''' + sh ''' cd ${WKC}/tests/pytest ./valgrind-test.sh 2>&1 > mem-error-out.log ./handle_val_log.sh From d343bb022f75af1b8155d258b99fe60e39d5b96b Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Thu, 25 Mar 2021 17:41:23 +0800 Subject: [PATCH 3/3] fix --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 00bd7fff77..405476ae6e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,7 +39,7 @@ def pre_test(){ sudo rmtaos || echo "taosd has not installed" ''' sh ''' - ps -ef | grep taosd | grep -v grep | awk '{print $2}' | xargs kill -9 //avoid taosd deadlock + ps -ef | grep taosd | grep -v grep | awk '{print $2}' | xargs kill -9 cd ${WKC} git checkout develop git reset --hard HEAD~10 >/dev/null