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

@ -604,6 +604,14 @@ class TMQCom:
except Exception as err:
processID = ""
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):
self.cursor.close()

View File

@ -176,12 +176,7 @@ class TDTestCase:
# use taosBenchmark to subscribe
binPath = self.getPath()
if platform.system().lower() == 'windows':
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)
tmqCom.startProcess(binPath, "-f ./7-tmq/tmqDropConsumer.json")
expectTopicNum = len(topicNameList)
consumerThreadNum = 2

View File

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