未验证 提交 c5aa858b 编写于 作者: wafwerar's avatar wafwerar 提交者: GitHub

Merge pull request #15401 from taosdata/fix/ZhiqiangWang/TD-13063-fix-win-test-stoptaosd-error

test: fix win test stop taosd error
...@@ -518,7 +518,7 @@ class TDDnode: ...@@ -518,7 +518,7 @@ class TDDnode:
if self.running != 0: if self.running != 0:
if platform.system().lower() == 'windows': if platform.system().lower() == 'windows':
psCmd = "for /f %%a in ('wmic process where \"name='taosd.exe' and CommandLine like '%%dnode%d%%'\" get processId ^| xargs echo ^| awk ^'{print $2}^'') do @(ps | grep %%a | awk '{print $1}' | xargs kill -INT )" % (self.index) psCmd = "for /f %%a in ('wmic process where \"name='taosd.exe' and CommandLine like '%%dnode%d%%'\" get processId ^| xargs echo ^| awk ^'{print $2}^' ^&^& echo aa') do @(ps | grep %%a | awk '{print $1}' )" % (self.index)
else: else:
psCmd = "ps -ef|grep -w %s| grep dnode%d|grep -v grep | awk '{print $2}'" % (toBeKilled,self.index) psCmd = "ps -ef|grep -w %s| grep dnode%d|grep -v grep | awk '{print $2}'" % (toBeKilled,self.index)
processID = subprocess.check_output( processID = subprocess.check_output(
......
...@@ -40,7 +40,7 @@ class ClusterComCheck: ...@@ -40,7 +40,7 @@ class ClusterComCheck:
def checkDnodes(self,dnodeNumbers): def checkDnodes(self,dnodeNumbers):
count=0 count=0
# print(tdSql) # print(tdSql)
while count < 5: while count < 30:
tdSql.query("show dnodes") tdSql.query("show dnodes")
# tdLog.debug(tdSql.queryResult) # tdLog.debug(tdSql.queryResult)
status=0 status=0
...@@ -50,13 +50,13 @@ class ClusterComCheck: ...@@ -50,13 +50,13 @@ class ClusterComCheck:
tdLog.info(status) tdLog.info(status)
if status == dnodeNumbers: if status == dnodeNumbers:
tdLog.success("it find cluster with %d dnodes and check that all cluster dnodes are ready within 5s! " %dnodeNumbers) tdLog.success("it find cluster with %d dnodes and check that all cluster dnodes are ready within 30s! " %dnodeNumbers)
return True return True
count+=1 count+=1
time.sleep(1) time.sleep(1)
else: else:
tdLog.debug(tdSql.queryResult) tdLog.debug(tdSql.queryResult)
tdLog.exit("it find cluster with %d dnodes but check that there dnodes are not ready within 5s ! "%dnodeNumbers) tdLog.exit("it find cluster with %d dnodes but check that there dnodes are not ready within 30s ! "%dnodeNumbers)
def checkDbRows(self,dbNumbers): def checkDbRows(self,dbNumbers):
dbNumbers=int(dbNumbers) dbNumbers=int(dbNumbers)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册