os: add taosd assert kill

This commit is contained in:
afwerar 2022-06-14 19:31:45 +08:00
parent b84120d068
commit 43afdc5ad0
3 changed files with 19 additions and 10 deletions

View File

@ -134,7 +134,7 @@ class TDTestCase:
parameterDict['cfg'] = cfgPath parameterDict['cfg'] = cfgPath
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict) prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start() prepareEnvThread.start()
time.sleep(2) prepareEnvThread.join()
# wait stb ready # wait stb ready
while 1: while 1:
@ -245,6 +245,7 @@ class TDTestCase:
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict) prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start() prepareEnvThread.start()
prepareEnvThread.join()
# wait db ready # wait db ready
while 1: while 1:
@ -371,6 +372,7 @@ class TDTestCase:
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict) prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start() prepareEnvThread.start()
prepareEnvThread.join()
# wait db ready # wait db ready
while 1: while 1:

View File

@ -61,19 +61,19 @@ goto :eof
set tt=%1 set tt=%1
set tt=%tt:.= % set tt=%tt:.= %
set tt=%tt::= % set tt=%tt::= %
set index=1 set /a index=1
for %%a in (%tt%) do ( for %%a in (%tt%) do (
if !index! EQU 1 ( if !index! EQU 1 (
set /a hh=%%a set /a hh=%%a || echo 11 %%a
)^ )^
else if !index! EQU 2 ( else if !index! EQU 2 (
set /a mm=%%a set /a mm=%%a || echo 22 %%a
)^ )^
else if !index! EQU 3 ( else if !index! EQU 3 (
set /a ss=%%a set /a ss=%%a || echo 33 %%a
) )
set /a index=index+1 set /a index=index+1
) )
set /a _timeTemp=(%hh%*60+%mm%)*60+%ss% || echo hh:%hh% mm:%mm% ss:%ss% set /a _timeTemp=(%hh%*60+%mm%)*60+%ss% || echo 44 hh:%hh% mm:%mm% ss:%ss%
goto :eof goto :eof

View File

@ -21,6 +21,7 @@ import base64
import json import json
import platform import platform
import socket import socket
import threading
from distutils.log import warn as printf from distutils.log import warn as printf
from fabric2 import Connection from fabric2 import Connection
sys.path.append("../pytest") sys.path.append("../pytest")
@ -30,6 +31,13 @@ from util.cases import *
import taos import taos
def checkRunTimeError():
import win32gui
while 1:
time.sleep(1)
hwnd = win32gui.FindWindow(None, "Microsoft Visual C++ Runtime Library")
if hwnd:
os.system("TASKKILL /F /IM taosd.exe")
if __name__ == "__main__": if __name__ == "__main__":
@ -42,9 +50,6 @@ if __name__ == "__main__":
logSql = True logSql = True
stop = 0 stop = 0
restart = False restart = False
windows = 0
if platform.system().lower() == 'windows':
windows = 1
updateCfgDict = {} updateCfgDict = {}
execCmd = "" execCmd = ""
opts, args = getopt.gnu_getopt(sys.argv[1:], 'f:p:m:l:scghrd:k:e:', [ opts, args = getopt.gnu_getopt(sys.argv[1:], 'f:p:m:l:scghrd:k:e:', [
@ -159,7 +164,9 @@ if __name__ == "__main__":
host = masterIp host = masterIp
tdLog.info("Procedures for tdengine deployed in %s" % (host)) tdLog.info("Procedures for tdengine deployed in %s" % (host))
if windows: if platform.system().lower() == 'windows':
if (masterIp == ""):
threading.Thread(target=checkRunTimeError,daemon=True).start()
tdCases.logSql(logSql) tdCases.logSql(logSql)
tdLog.info("Procedures for testing self-deployment") tdLog.info("Procedures for testing self-deployment")
tdDnodes.init(deployPath, masterIp) tdDnodes.init(deployPath, masterIp)