From 7c659cc3022852a9c96921896b6e7e12334c9219 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Wed, 17 Jun 2020 23:17:28 +0800 Subject: [PATCH] make stop taosd by kill always done with continue check [TD-670] --- tests/script/general/parser/limit1_tblocks100.sim | 3 +-- tests/script/sh/exec.sh | 10 +++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/script/general/parser/limit1_tblocks100.sim b/tests/script/general/parser/limit1_tblocks100.sim index 99ffd31f6d..2235e6b424 100644 --- a/tests/script/general/parser/limit1_tblocks100.sim +++ b/tests/script/general/parser/limit1_tblocks100.sim @@ -61,11 +61,10 @@ run general/parser/limit1_stb.sim print ================== restart server to commit data into disk system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 5000 system sh/exec.sh -n dnode1 -s start print ================== server restart completed run general/parser/limit1_tb.sim run general/parser/limit1_stb.sim -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/sh/exec.sh b/tests/script/sh/exec.sh index 1e033071f7..6928039be1 100755 --- a/tests/script/sh/exec.sh +++ b/tests/script/sh/exec.sh @@ -97,13 +97,17 @@ else #relative path RCFG_DIR=sim/$NODE_NAME/cfg PID=`ps -ef|grep taosd | grep $RCFG_DIR | grep -v grep | awk '{print $2}'` - if [ -n "$PID" ]; then + while [ -n "$PID" ] + do if [ "$SIGNAL" = "SIGINT" ]; then - echo killed by signal + echo try to kill by signal SIGINT kill -SIGINT $PID else + echo try to kill by signal SIGKILL kill -9 $PID fi - fi + sleep 1 + PID=`ps -ef|grep taosd | grep $RCFG_DIR | grep -v grep | awk '{print $2}'` + done fi