chore: add startProcess for tmq common
This commit is contained in:
parent
cc62c400c6
commit
cf4da465e1
|
@ -604,6 +604,14 @@ class TMQCom:
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
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()
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue