提交 d914578d 编写于 作者: haoranc's avatar haoranc

test: add robustness testcase of wal index files

上级 f233afe1
......@@ -17,32 +17,6 @@ from util.dnodes import *
from util.cluster import *
class TDTestCase:
#updatecfgDict = {'clientCfg': {'serverPort': 7080, 'firstEp': 'trd02:7080', 'secondEp':'trd02:7080'},\
# 'serverPort': 7080, 'firstEp': 'trd02:7080'}
# 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'
# rpcDebugFlagVal = '143'
# clientCfgDict = {'serverPort': '', 'firstEp': '', 'secondEp':'', 'rpcDebugFlag':'135', 'fqdn':''}
# clientCfgDict["serverPort"] = serverPort
# clientCfgDict["firstEp"] = hostname + ':' + serverPort
# clientCfgDict["secondEp"] = hostname + ':' + serverPort
# clientCfgDict["rpcDebugFlag"] = rpcDebugFlagVal
# clientCfgDict["fqdn"] = hostname
# updatecfgDict = {'clientCfg': {}, 'serverPort': '', 'firstEp': '', 'secondEp':'', 'rpcDebugFlag':'135', 'fqdn':''}
# updatecfgDict["clientCfg"] = clientCfgDict
# updatecfgDict["serverPort"] = serverPort
# updatecfgDict["firstEp"] = hostname + ':' + serverPort
# updatecfgDict["secondEp"] = hostname + ':' + serverPort
# updatecfgDict["fqdn"] = hostname
# print ("===================: ", updatecfgDict)
def init(self, conn, logSql):
tdLog.debug(f"start to excute {__file__}")
......@@ -64,49 +38,6 @@ class TDTestCase:
break
return buildPath
def get_process_pid(self,processname):
#origin artical link:https://blog.csdn.net/weixin_45623536/article/details/122099062
process_info_list = []
process = os.popen('ps -A | grep %s'% processname)
process_info = process.read()
for i in process_info.split(' '):
if i != "":
process_info_list.append(i)
print(process_info_list)
if len(process_info_list) != 0 :
pid = int(process_info_list[0])
else :
pid = 0
return pid
def checkAndstopPro(self,processName,startAction):
i = 1
count = 10
for i in range(count):
taosdPid=self.get_process_pid(processName)
if taosdPid != 0 and taosdPid != "" :
tdLog.info("stop taosd %s ,kill pid :%s "%(startAction,taosdPid))
os.system("kill -9 %d"%taosdPid)
break
else:
tdLog.info( "wait start taosd ,times: %d "%i)
sleep
i+= 1
else :
tdLog.exit("taosd %s is not running "%startAction)
def taosdCommandStop(self,startAction,taosdCmdRun):
processName="taosd"
taosdCmd = taosdCmdRun + startAction
tdLog.printNoPrefix("%s"%taosdCmd)
os.system(f"nohup {taosdCmd} & ")
self.checkAndstopPro(processName,startAction)
def taosdCommandExe(self,startAction,taosdCmdRun):
taosdCmd = taosdCmdRun + startAction
tdLog.printNoPrefix("%s"%taosdCmd)
os.system(f"{taosdCmd}")
def preData(self):
# database\stb\tb\chiild-tb\rows\topics
tdSql.execute("create user testpy pass 'testpy'")
......@@ -133,9 +64,6 @@ class TDTestCase:
tdSql.query("create table source_db.ct1 using source_db.stb tags(1000);create table source_db.ct2 using source_db.stb tags(2000);create table source_db.ct3 using source_db.stb tags(3000);")
tdSql.query("create stream s1 into source_db.output_stb as select _wstart AS start, min(k), max(k), sum(k) from source_db.stb interval(10m);")
def run(self):
buildPath = self.getBuildPath()
if (buildPath == ""):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册