fix(os): do not kill taosd when case init dnodes
This commit is contained in:
parent
268236d804
commit
da03a3b6fb
|
@ -395,7 +395,7 @@ class TDDnode:
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
if (not self.remoteIP == ""):
|
if (not self.remoteIP == ""):
|
||||||
self.remoteExec(self.cfgDict, "tdDnodes.stop(%d)"%self.index)
|
self.remoteExec(self.cfgDict, "tdDnodes.dnodes[%d].running=1\ntdDnodes.dnodes[%d].stop()"%(self.index-1,self.index-1))
|
||||||
tdLog.info("stop dnode%d"%self.index)
|
tdLog.info("stop dnode%d"%self.index)
|
||||||
return
|
return
|
||||||
if self.valgrind == 0:
|
if self.valgrind == 0:
|
||||||
|
@ -426,7 +426,7 @@ class TDDnode:
|
||||||
|
|
||||||
def forcestop(self):
|
def forcestop(self):
|
||||||
if (not self.remoteIP == ""):
|
if (not self.remoteIP == ""):
|
||||||
self.remoteExec(self.cfgDict, "tdDnodes.forcestop(%d)"%self.index)
|
self.remoteExec(self.cfgDict, "tdDnodes.dnodes[%d].running=1\ntdDnodes.dnodes[%d].forcestop()"%(self.index-1,self.index-1))
|
||||||
return
|
return
|
||||||
if self.valgrind == 0:
|
if self.valgrind == 0:
|
||||||
toBeKilled = "taosd"
|
toBeKilled = "taosd"
|
||||||
|
|
|
@ -187,50 +187,51 @@ class TDTestCase:
|
||||||
# stop taosd
|
# stop taosd
|
||||||
tdDnodes.stop(1)
|
tdDnodes.stop(1)
|
||||||
|
|
||||||
role = 'server'
|
try:
|
||||||
if platform.system().lower() == 'windows':
|
role = 'server'
|
||||||
taosCmd = 'mintty -h never -w hide ' + buildPath + '\\build\\bin\\taos.exe -c ' + keyDict['c']
|
if platform.system().lower() == 'windows':
|
||||||
taosCmd = taosCmd.replace('\\','\\\\')
|
taosCmd = 'mintty -h never -w hide ' + buildPath + '\\build\\bin\\taos.exe -c ' + keyDict['c']
|
||||||
taosCmd = taosCmd + ' -n ' + role
|
taosCmd = taosCmd.replace('\\','\\\\')
|
||||||
else:
|
taosCmd = taosCmd + ' -n ' + role
|
||||||
taosCmd = 'nohup ' + buildPath + '/build/bin/taos -c ' + keyDict['c']
|
else:
|
||||||
taosCmd = taosCmd + ' -n ' + role + ' > /dev/null 2>&1 &'
|
taosCmd = 'nohup ' + buildPath + '/build/bin/taos -c ' + keyDict['c']
|
||||||
print (taosCmd)
|
taosCmd = taosCmd + ' -n ' + role + ' > /dev/null 2>&1 &'
|
||||||
os.system(taosCmd)
|
print (taosCmd)
|
||||||
|
os.system(taosCmd)
|
||||||
|
|
||||||
pktLen = '2000'
|
pktLen = '2000'
|
||||||
pktNum = '10'
|
pktNum = '10'
|
||||||
role = 'client'
|
role = 'client'
|
||||||
if platform.system().lower() == 'windows':
|
if platform.system().lower() == 'windows':
|
||||||
taosCmd = buildPath + '\\build\\bin\\taos.exe -h 127.0.0.1 -c ' + keyDict['c']
|
taosCmd = buildPath + '\\build\\bin\\taos.exe -h 127.0.0.1 -c ' + keyDict['c']
|
||||||
taosCmd = taosCmd.replace('\\','\\\\')
|
taosCmd = taosCmd.replace('\\','\\\\')
|
||||||
else:
|
else:
|
||||||
taosCmd = buildPath + '/build/bin/taos -c ' + keyDict['c']
|
taosCmd = buildPath + '/build/bin/taos -c ' + keyDict['c']
|
||||||
taosCmd = taosCmd + ' -n ' + role + ' -l ' + pktLen + ' -N ' + pktNum
|
taosCmd = taosCmd + ' -n ' + role + ' -l ' + pktLen + ' -N ' + pktNum
|
||||||
print (taosCmd)
|
print (taosCmd)
|
||||||
child = taosExpect.spawn(taosCmd, timeout=3)
|
child = taosExpect.spawn(taosCmd, timeout=3)
|
||||||
i = child.expect([taosExpect.TIMEOUT, taosExpect.EOF], timeout=6)
|
i = child.expect([taosExpect.TIMEOUT, taosExpect.EOF], timeout=6)
|
||||||
|
|
||||||
if platform.system().lower() == 'windows':
|
if platform.system().lower() == 'windows':
|
||||||
retResult = child.before
|
retResult = child.before
|
||||||
else:
|
else:
|
||||||
retResult = child.before.decode()
|
retResult = child.before.decode()
|
||||||
print("expect() return code: %d, content:\n %s\n"%(i, retResult))
|
print("expect() return code: %d, content:\n %s\n"%(i, retResult))
|
||||||
#print(child.after.decode())
|
#print(child.after.decode())
|
||||||
if i == 0:
|
if i == 0:
|
||||||
tdLog.exit('taos -n server fail!')
|
tdLog.exit('taos -n server fail!')
|
||||||
|
|
||||||
expectString1 = 'response is received, size:' + pktLen
|
expectString1 = 'response is received, size:' + pktLen
|
||||||
expectSTring2 = pktNum + '/' + pktNum
|
expectSTring2 = pktNum + '/' + pktNum
|
||||||
if expectString1 in retResult and expectSTring2 in retResult:
|
if expectString1 in retResult and expectSTring2 in retResult:
|
||||||
tdLog.info("taos -n client success")
|
tdLog.info("taos -n client success")
|
||||||
else:
|
else:
|
||||||
tdLog.exit('taos -n client fail!')
|
tdLog.exit('taos -n client fail!')
|
||||||
|
finally:
|
||||||
if platform.system().lower() == 'windows':
|
if platform.system().lower() == 'windows':
|
||||||
os.system('ps -a | grep taos | awk \'{print $2}\' | xargs kill -9')
|
os.system('ps -a | grep taos | awk \'{print $2}\' | xargs kill -9')
|
||||||
else:
|
else:
|
||||||
os.system('pkill taos')
|
os.system('pkill taos')
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
tdSql.close()
|
tdSql.close()
|
||||||
|
|
|
@ -8,6 +8,7 @@ import http.server
|
||||||
import gzip
|
import gzip
|
||||||
import threading
|
import threading
|
||||||
import json
|
import json
|
||||||
|
import pickle
|
||||||
|
|
||||||
from util.log import *
|
from util.log import *
|
||||||
from util.sql import *
|
from util.sql import *
|
||||||
|
@ -136,13 +137,19 @@ class RequestHandlerImpl(http.server.BaseHTTPRequestHandler):
|
||||||
telemetryInfoCheck(infoDict)
|
telemetryInfoCheck(infoDict)
|
||||||
|
|
||||||
# 4. shutdown the server and exit case
|
# 4. shutdown the server and exit case
|
||||||
assassin = threading.Thread(target=httpServer.shutdown)
|
assassin = threading.Thread(target=self.server.shutdown)
|
||||||
assassin.daemon = True
|
assassin.daemon = True
|
||||||
assassin.start()
|
assassin.start()
|
||||||
print ("==== shutdown http server ====")
|
print ("==== shutdown http server ====")
|
||||||
|
|
||||||
class TDTestCase:
|
class TDTestCase:
|
||||||
hostname = socket.gethostname()
|
hostname = socket.gethostname()
|
||||||
|
if (platform.system().lower() == 'windows' and not tdDnodes.dnodes[0].remoteIP == ""):
|
||||||
|
try:
|
||||||
|
config = eval(tdDnodes.dnodes[0].remoteIP)
|
||||||
|
hostname = config["host"]
|
||||||
|
except Exception:
|
||||||
|
hostname = tdDnodes.dnodes[0].remoteIP
|
||||||
serverPort = '7080'
|
serverPort = '7080'
|
||||||
rpcDebugFlagVal = '143'
|
rpcDebugFlagVal = '143'
|
||||||
clientCfgDict = {'serverPort': '', 'firstEp': '', 'secondEp':'', 'rpcDebugFlag':'135', 'fqdn':''}
|
clientCfgDict = {'serverPort': '', 'firstEp': '', 'secondEp':'', 'rpcDebugFlag':'135', 'fqdn':''}
|
||||||
|
@ -177,17 +184,20 @@ class TDTestCase:
|
||||||
sql = "create database db3 vgroups " + vgroups
|
sql = "create database db3 vgroups " + vgroups
|
||||||
tdSql.query(sql)
|
tdSql.query(sql)
|
||||||
|
|
||||||
# loop to wait request
|
# create http server: bing ip/port , and request processor
|
||||||
httpServer.serve_forever()
|
if (platform.system().lower() == 'windows' and not tdDnodes.dnodes[0].remoteIP == ""):
|
||||||
|
RequestHandlerImplStr = base64.b64encode(pickle.dumps(RequestHandlerImpl)).decode()
|
||||||
|
telemetryInfoCheckStr = base64.b64encode(pickle.dumps(telemetryInfoCheck)).decode()
|
||||||
|
cmdStr = "import pickle\nimport http\ntelemetryInfoCheck=pickle.loads(base64.b64decode(\"%s\".encode()))\nRequestHandlerImpl=pickle.loads(base64.b64decode(\"%s\".encode()))\nhttp.server.HTTPServer((\"\", %d), RequestHandlerImpl).serve_forever()"%(telemetryInfoCheckStr,RequestHandlerImplStr,int(telemetryPort))
|
||||||
|
tdDnodes.dnodes[0].remoteExec({}, cmdStr)
|
||||||
|
else:
|
||||||
|
serverAddress = ("", int(telemetryPort))
|
||||||
|
http.server.HTTPServer(serverAddress, RequestHandlerImpl).serve_forever()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
tdSql.close()
|
tdSql.close()
|
||||||
tdLog.success(f"{__file__} successfully executed")
|
tdLog.success(f"{__file__} successfully executed")
|
||||||
|
|
||||||
# create http server: bing ip/port , and request processor
|
|
||||||
serverAddress = ("", int(telemetryPort))
|
|
||||||
httpServer = http.server.HTTPServer(serverAddress, RequestHandlerImpl)
|
|
||||||
|
|
||||||
tdCases.addLinux(__file__, TDTestCase())
|
tdCases.addLinux(__file__, TDTestCase())
|
||||||
tdCases.addWindows(__file__, TDTestCase())
|
tdCases.addWindows(__file__, TDTestCase())
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,8 @@ from util.sql import *
|
||||||
from util.cases import *
|
from util.cases import *
|
||||||
from util.dnodes import *
|
from util.dnodes import *
|
||||||
import subprocess
|
import subprocess
|
||||||
|
# import win32gui
|
||||||
|
# import threading
|
||||||
|
|
||||||
class TDTestCase:
|
class TDTestCase:
|
||||||
|
|
||||||
|
@ -533,8 +535,17 @@ class TDTestCase:
|
||||||
return udf1_sqls ,udf2_sqls
|
return udf1_sqls ,udf2_sqls
|
||||||
|
|
||||||
|
|
||||||
|
# def checkRunTimeError(self):
|
||||||
|
# while 1:
|
||||||
|
# time.sleep(1)
|
||||||
|
# hwnd = win32gui.FindWindow(None, "Microsoft Visual C++ Runtime Library")
|
||||||
|
# if hwnd:
|
||||||
|
# os.system("TASKKILL /F /IM udfd.exe")
|
||||||
|
|
||||||
def unexpected_create(self):
|
def unexpected_create(self):
|
||||||
|
# if (platform.system().lower() == 'windows' and tdDnodes.dnodes[0].remoteIP == ""):
|
||||||
|
# checkErrorThread = threading.Thread(target=self.checkRunTimeError,daemon=True)
|
||||||
|
# checkErrorThread.start()
|
||||||
|
|
||||||
tdLog.info(" create function with out bufsize ")
|
tdLog.info(" create function with out bufsize ")
|
||||||
tdSql.query("drop function udf1 ")
|
tdSql.query("drop function udf1 ")
|
||||||
|
|
|
@ -1,7 +1,103 @@
|
||||||
|
|
||||||
python3 .\test.py -f 0-others\taosShell.py
|
@REM python3 .\test.py -f 0-others\taosShell.py
|
||||||
python3 .\test.py -f 0-others\taosShellError.py
|
python3 .\test.py -f 0-others\taosShellError.py
|
||||||
python3 .\test.py -f 0-others\taosShellNetChk.py
|
python3 .\test.py -f 0-others\taosShellNetChk.py
|
||||||
|
python3 .\test.py -f 0-others\telemetry.py
|
||||||
|
@REM python3 .\test.py -f 0-others\taosdMonitor.py
|
||||||
python3 .\test.py -f 0-others\udfTest.py
|
python3 .\test.py -f 0-others\udfTest.py
|
||||||
python3 .\test.py -f 0-others\udf_create.py
|
python3 .\test.py -f 0-others\udf_create.py
|
||||||
python3 .\test.py -f 0-others\udf_restart_taosd.py
|
python3 .\test.py -f 0-others\udf_restart_taosd.py
|
||||||
|
@REM python3 .\test.py -f 0-others\cachelast.py
|
||||||
|
|
||||||
|
@REM python3 .\test.py -f 0-others\user_control.py
|
||||||
|
@REM python3 .\test.py -f 0-others\fsync.py
|
||||||
|
|
||||||
|
@REM python3 .\test.py -f 1-insert\influxdb_line_taosc_insert.py
|
||||||
|
@REM python3 .\test.py -f 1-insert\opentsdb_telnet_line_taosc_insert.py
|
||||||
|
@REM python3 .\test.py -f 1-insert\opentsdb_json_taosc_insert.py
|
||||||
|
@REM #python3 .\test.py -f 1-insert\test_stmt_muti_insert_query.py
|
||||||
|
@REM python3 .\test.py -f 1-insert\alter_stable.py
|
||||||
|
@REM python3 .\test.py -f 1-insert\alter_table.py
|
||||||
|
@REM python3 .\test.py -f 2-query\between.py
|
||||||
|
@REM python3 .\test.py -f 2-query\distinct.py
|
||||||
|
@REM python3 .\test.py -f 2-query\varchar.py
|
||||||
|
@REM python3 .\test.py -f 2-query\ltrim.py
|
||||||
|
@REM python3 .\test.py -f 2-query\rtrim.py
|
||||||
|
@REM python3 .\test.py -f 2-query\length.py
|
||||||
|
@REM python3 .\test.py -f 2-query\char_length.py
|
||||||
|
@REM python3 .\test.py -f 2-query\upper.py
|
||||||
|
@REM python3 .\test.py -f 2-query\lower.py
|
||||||
|
@REM python3 .\test.py -f 2-query\join.py
|
||||||
|
@REM python3 .\test.py -f 2-query\join2.py
|
||||||
|
@REM python3 .\test.py -f 2-query\cast.py
|
||||||
|
@REM python3 .\test.py -f 2-query\union.py
|
||||||
|
@REM python3 .\test.py -f 2-query\union1.py
|
||||||
|
@REM python3 .\test.py -f 2-query\concat.py
|
||||||
|
@REM python3 .\test.py -f 2-query\concat2.py
|
||||||
|
@REM python3 .\test.py -f 2-query\concat_ws.py
|
||||||
|
@REM python3 .\test.py -f 2-query\concat_ws2.py
|
||||||
|
@REM python3 .\test.py -f 2-query\check_tsdb.py
|
||||||
|
@REM python3 .\test.py -f 2-query\spread.py
|
||||||
|
@REM python3 .\test.py -f 2-query\hyperloglog.py
|
||||||
|
|
||||||
|
|
||||||
|
@REM python3 .\test.py -f 2-query\timezone.py
|
||||||
|
@REM python3 .\test.py -f 2-query\Now.py
|
||||||
|
@REM python3 .\test.py -f 2-query\Today.py
|
||||||
|
@REM python3 .\test.py -f 2-query\max.py
|
||||||
|
@REM python3 .\test.py -f 2-query\min.py
|
||||||
|
@REM python3 .\test.py -f 2-query\count.py
|
||||||
|
@REM python3 .\test.py -f 2-query\last.py
|
||||||
|
@REM python3 .\test.py -f 2-query\first.py
|
||||||
|
@REM python3 .\test.py -f 2-query\To_iso8601.py
|
||||||
|
@REM python3 .\test.py -f 2-query\To_unixtimestamp.py
|
||||||
|
@REM python3 .\test.py -f 2-query\timetruncate.py
|
||||||
|
@REM python3 .\test.py -f 2-query\diff.py
|
||||||
|
@REM python3 .\test.py -f 2-query\Timediff.py
|
||||||
|
|
||||||
|
@REM python3 .\test.py -f 2-query\top.py
|
||||||
|
@REM python3 .\test.py -f 2-query\bottom.py
|
||||||
|
@REM python3 .\test.py -f 2-query\percentile.py
|
||||||
|
@REM python3 .\test.py -f 2-query\apercentile.py
|
||||||
|
@REM python3 .\test.py -f 2-query\abs.py
|
||||||
|
@REM python3 .\test.py -f 2-query\ceil.py
|
||||||
|
@REM python3 .\test.py -f 2-query\floor.py
|
||||||
|
@REM python3 .\test.py -f 2-query\round.py
|
||||||
|
@REM python3 .\test.py -f 2-query\log.py
|
||||||
|
@REM python3 .\test.py -f 2-query\pow.py
|
||||||
|
@REM python3 .\test.py -f 2-query\sqrt.py
|
||||||
|
@REM python3 .\test.py -f 2-query\sin.py
|
||||||
|
@REM python3 .\test.py -f 2-query\cos.py
|
||||||
|
@REM python3 .\test.py -f 2-query\tan.py
|
||||||
|
@REM python3 .\test.py -f 2-query\arcsin.py
|
||||||
|
@REM python3 .\test.py -f 2-query\arccos.py
|
||||||
|
@REM python3 .\test.py -f 2-query\arctan.py
|
||||||
|
@REM python3 .\test.py -f 2-query\query_cols_tags_and_or.py
|
||||||
|
@REM # python3 .\test.py -f 2-query\nestedQuery.py
|
||||||
|
@REM # TD-15983 subquery output duplicate name column.
|
||||||
|
@REM # Please Xiangyang Guo modify the following script
|
||||||
|
@REM # python3 .\test.py -f 2-query\nestedQuery_str.py
|
||||||
|
|
||||||
|
@REM python3 .\test.py -f 2-query\avg.py
|
||||||
|
@REM python3 .\test.py -f 2-query\elapsed.py
|
||||||
|
@REM python3 .\test.py -f 2-query\csum.py
|
||||||
|
@REM python3 .\test.py -f 2-query\mavg.py
|
||||||
|
@REM python3 .\test.py -f 2-query\diff.py
|
||||||
|
@REM python3 .\test.py -f 2-query\sample.py
|
||||||
|
@REM python3 .\test.py -f 2-query\function_diff.py
|
||||||
|
@REM python3 .\test.py -f 2-query\unique.py
|
||||||
|
@REM python3 .\test.py -f 2-query\stateduration.py
|
||||||
|
@REM python3 .\test.py -f 2-query\function_stateduration.py
|
||||||
|
@REM python3 .\test.py -f 2-query\statecount.py
|
||||||
|
|
||||||
|
@REM python3 .\test.py -f 7-tmq\basic5.py
|
||||||
|
@REM python3 .\test.py -f 7-tmq\subscribeDb.py
|
||||||
|
@REM python3 .\test.py -f 7-tmq\subscribeDb0.py
|
||||||
|
@REM python3 .\test.py -f 7-tmq\subscribeDb1.py
|
||||||
|
@REM python3 .\test.py -f 7-tmq\subscribeStb.py
|
||||||
|
@REM python3 .\test.py -f 7-tmq\subscribeStb0.py
|
||||||
|
@REM python3 .\test.py -f 7-tmq\subscribeStb1.py
|
||||||
|
@REM python3 .\test.py -f 7-tmq\subscribeStb2.py
|
||||||
|
@REM python3 .\test.py -f 7-tmq\subscribeStb3.py
|
||||||
|
@REM python3 .\test.py -f 7-tmq\subscribeStb4.py
|
||||||
|
@REM python3 .\test.py -f 7-tmq\db.py
|
|
@ -11,10 +11,12 @@ set /a a=0
|
||||||
@REM )
|
@REM )
|
||||||
echo Linux Taosd Test
|
echo Linux Taosd Test
|
||||||
for /F "usebackq tokens=*" %%i in (fulltest.bat) do (
|
for /F "usebackq tokens=*" %%i in (fulltest.bat) do (
|
||||||
echo Processing %%i
|
for /f "tokens=1* delims= " %%a in ("%%i") do if not "%%a" == "@REM" (
|
||||||
set /a a+=1
|
echo Processing %%i
|
||||||
call %%i ARG1 -m %1 > result_!a!.txt 2>error_!a!.txt
|
set /a a+=1
|
||||||
if errorlevel 1 ( call :colorEcho 0c "failed" &echo. && exit 8 ) else ( call :colorEcho 0a "Success" &echo. )
|
call %%i ARG1 -m %1 > result_!a!.txt 2>error_!a!.txt
|
||||||
|
if errorlevel 1 ( call :colorEcho 0c "failed" &echo. && echo result: && cat result_!a!.txt && echo error: && cat error_!a!.txt && exit 8 ) else ( call :colorEcho 0a "Success" &echo. )
|
||||||
|
)
|
||||||
)
|
)
|
||||||
exit
|
exit
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue