chore: add startProcess for tmq common

This commit is contained in:
kailixu 2023-08-16 22:43:01 +08:00
parent cc62c400c6
commit cf4da465e1
3 changed files with 10 additions and 9 deletions

View File

@ -605,6 +605,14 @@ class TMQCom:
processID = "" processID = ""
print('**** warn: ', err) print('**** warn: ', err)
def startProcess(self, processName, param):
if platform.system().lower() == 'windows':
cmd = f"mintty -h never %s %s > NUL 2>&1" % (processName, param)
else:
cmd = f"nohup %s %s > /dev/null 2>&1 &" % (processName, param)
tdLog.info("%s"%(cmd))
os.system(cmd)
def close(self): def close(self):
self.cursor.close() self.cursor.close()

View File

@ -176,12 +176,7 @@ class TDTestCase:
# use taosBenchmark to subscribe # use taosBenchmark to subscribe
binPath = self.getPath() binPath = self.getPath()
if platform.system().lower() == 'windows': tmqCom.startProcess(binPath, "-f ./7-tmq/tmqDropConsumer.json")
cmd = f"mintty -h never %s -f ./7-tmq/tmqDropConsumer.json > NUL 2>&1" % binPath
else:
cmd = f"nohup %s -f ./7-tmq/tmqDropConsumer.json > /dev/null 2>&1 & " % binPath
tdLog.info("%s"%(cmd))
os.system(cmd)
expectTopicNum = len(topicNameList) expectTopicNum = len(topicNameList)
consumerThreadNum = 2 consumerThreadNum = 2

View File

@ -176,9 +176,7 @@ class TDTestCase:
# use taosBenchmark to subscribe # use taosBenchmark to subscribe
binPath = self.getPath() binPath = self.getPath()
cmd = "nohup %s -f ./7-tmq/tmqMaxGroupIds.json > /dev/null 2>&1 & " % binPath tmqCom.startProcess(binPath, "-f ./7-tmq/tmqMaxGroupIds.json")
tdLog.info("%s"%(cmd))
os.system(cmd)
expectTopicNum = 1 expectTopicNum = 1
expectConsumerNUm = 99 expectConsumerNUm = 99