From 39931e3e1ed0f99dcbc1129a919844a6649de430 Mon Sep 17 00:00:00 2001 From: Zhiyu Yang <69311263+zyyang-taosdata@users.noreply.github.com> Date: Mon, 7 Feb 2022 16:31:51 +0800 Subject: [PATCH] [TD-13342]: fix CI test failed when taosadapter.toml is missing (#10110) * [TD-13342]: fix CI test failed when taosadapter.toml is missing * use config file * stop taosadapter --- tests/develop-test/3-connectors/java/test.sh | 26 +++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/tests/develop-test/3-connectors/java/test.sh b/tests/develop-test/3-connectors/java/test.sh index 8b43d1a443..9a3e7cbb08 100755 --- a/tests/develop-test/3-connectors/java/test.sh +++ b/tests/develop-test/3-connectors/java/test.sh @@ -1,20 +1,28 @@ #!/bin/bash -function stopTaosd { - echo "Stop taosd" - sudo systemctl stop taosd || echo 'no sudo or systemctl or stop fail' - PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + +function stopProcess { + echo "Stop $1" + sudo systemctl stop $1 || echo 'no sudo or systemctl or stop fail' + PID=`ps -ef|grep -w $1 | grep -v grep | awk '{print $2}'` while [ -n "$PID" ] do - pkill -TERM -x taosd + pkill -TERM -x $1 sleep 1 - PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + PID=`ps -ef|grep -w $1 | grep -v grep | awk '{print $2}'` done } -stopTaosd + +stopProcess taosadapter +stopProcess taosd rm -rf /var/lib/taos/* rm -rf /var/log/taos/* -nohup taosd -c /etc/taos/ > /dev/null 2>&1 & -nohup taosadapter -c /etc/taos/taosadapter.toml > /dev/null 2>&1 & + +curDir=$(dirname $(readlink -f "$0")) +taosdConfig=$curDir/../../../../packaging/cfg +adapterConfig=$curDir/../../../../src/plugins/taosadapter/example/config/taosadapter.toml + +nohup taosd -c ${taosdConfig} > /dev/null 2>&1 & +nohup taosadapter -c ${adapterConfig} > /dev/null 2>&1 & sleep 10 cd ../../../../ -- GitLab