From 3f8e90670f3699905331336824dfc64ab63e1205 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 16 Mar 2021 16:10:54 +0800 Subject: [PATCH 1/5] [TD-3326]backup taos after taos coredump --- tests/test-all.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test-all.sh b/tests/test-all.sh index db9d6523a0..b91440c7c6 100755 --- a/tests/test-all.sh +++ b/tests/test-all.sh @@ -24,11 +24,14 @@ function stopTaosd { function dohavecore(){ corefile=`find $corepath -mmin 1` + proc=`echo $corefile|cut -d "_" -f2` if [ -n "$corefile" ];then - echo 'taosd or taos has generated core' - if [[ $1 == 1 ]];then - exit 8 - fi + echo 'taosd or taos has generated core' + echo '\n'|gdb /usr/local/taos/bin/$proc $corepath/$corefile -ex "bt 10" -ex quit + tar zcvf $corepath/taos_`date "+%Y_%m_%d_%H:%M:%S"`.tar.gz /usr/local/taos + if [[ $1 == 1 ]];then + exit 8 + fi fi } function runSimCaseOneByOne { From f4aa1da2351614fd75b3c6e5a32130c34404be41 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 16 Mar 2021 16:19:45 +0800 Subject: [PATCH 2/5] fix error --- tests/test-all.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-all.sh b/tests/test-all.sh index b91440c7c6..7cd08e2510 100755 --- a/tests/test-all.sh +++ b/tests/test-all.sh @@ -24,12 +24,12 @@ function stopTaosd { function dohavecore(){ corefile=`find $corepath -mmin 1` - proc=`echo $corefile|cut -d "_" -f2` + proc=`echo $corefile|cut -d "_" -f3` if [ -n "$corefile" ];then echo 'taosd or taos has generated core' - echo '\n'|gdb /usr/local/taos/bin/$proc $corepath/$corefile -ex "bt 10" -ex quit tar zcvf $corepath/taos_`date "+%Y_%m_%d_%H:%M:%S"`.tar.gz /usr/local/taos if [[ $1 == 1 ]];then + echo '\n'|gdb /usr/local/taos/bin/$proc $corepath/$corefile -ex "bt 10" -ex quit exit 8 fi fi From d0254171b7e3f24f4c302847c829d105499ef89e Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 16 Mar 2021 17:26:13 +0800 Subject: [PATCH 3/5] fix error --- tests/test-all.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test-all.sh b/tests/test-all.sh index 7cd08e2510..bda03191d1 100755 --- a/tests/test-all.sh +++ b/tests/test-all.sh @@ -24,12 +24,14 @@ function stopTaosd { function dohavecore(){ corefile=`find $corepath -mmin 1` + core_file=`echo $corefile|cut -d " " -f2` + echo $core_file proc=`echo $corefile|cut -d "_" -f3` if [ -n "$corefile" ];then echo 'taosd or taos has generated core' - tar zcvf $corepath/taos_`date "+%Y_%m_%d_%H:%M:%S"`.tar.gz /usr/local/taos + tar -zcvPf $corepath'taos_'`date "+%Y_%m_%d_%H_%M_%S"`.tar.gz /usr/local/taos/ if [[ $1 == 1 ]];then - echo '\n'|gdb /usr/local/taos/bin/$proc $corepath/$corefile -ex "bt 10" -ex quit + echo '\n'|gdb /usr/local/taos/bin/$proc $core_file -ex "bt 10" -ex quit exit 8 fi fi From 6d152e198f673ef8105c3f572595f38fb037e6ba Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Wed, 17 Mar 2021 09:23:50 +0800 Subject: [PATCH 4/5] Reduce unnecessary output --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e7603b578b..45993ffe05 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,14 +42,14 @@ def pre_test(){ cd ${WKC} git checkout develop git reset --hard HEAD~10 >/dev/null - git pull + git pull >/dev/null git fetch origin +refs/pull/${CHANGE_ID}/merge git checkout -qf FETCH_HEAD - git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD develop)|grep -v -E '.*md|//src//connector|Jenkinsfile' || exit 0 + git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD develop)|grep -v -E '.*md|//src//connector|Jenkinsfile' find ${WKC}/tests/pytest -name \'*\'.sql -exec rm -rf {} \\; cd ${WK} git reset --hard HEAD~10 - git checkout develop + git checkout develop >/dev/null git pull cd ${WK} export TZ=Asia/Harbin From 9d52d7983f8544cbb0a62376c26925ed1e01f5ca Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Wed, 17 Mar 2021 09:52:38 +0800 Subject: [PATCH 5/5] fix --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 45993ffe05..68fe4879c1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,8 +49,8 @@ def pre_test(){ find ${WKC}/tests/pytest -name \'*\'.sql -exec rm -rf {} \\; cd ${WK} git reset --hard HEAD~10 - git checkout develop >/dev/null - git pull + git checkout develop + git pull >/dev/null cd ${WK} export TZ=Asia/Harbin date