Merge pull request #5042 from taosdata/test/testcase

<test>fix some error in python test frame
This commit is contained in:
huili 2021-01-27 09:51:51 +08:00 committed by GitHub
commit 9a64b8a429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 7 deletions

View File

@ -56,6 +56,15 @@ class TDTestCase:
tdDnodes.startWithoutSleep(1)
tdSql.taosdStatus(1)
tdSql.haveFile('/mnt/data00',1)
tdSql.haveFile('/mnt/data01',1)
tdSql.haveFile('/mnt/data02',1)
tdSql.haveFile('/mnt/data10',1)
tdSql.haveFile('/mnt/data11',1)
tdSql.haveFile('/mnt/data12',1)
tdSql.haveFile('/mnt/data20',1)
tdSql.haveFile('/mnt/data21',1)
tdSql.haveFile('/mnt/data22',1)
def stop(self):
tdSql.close()

View File

@ -194,11 +194,16 @@ class TDSql:
pstate = 0
pl = psutil.pids()
for pid in pl:
if psutil.Process(pid).name == 'taosd':
try:
if psutil.Process(pid).name() == 'taosd':
print('have already started')
pstate = 1
break
if pstate:
tdLog.sleep(5)
except psutil.NoSuchProcess:
pass
if pstate == state :break
if state or pstate:
tdLog.sleep(1)
continue
pstate = 0
break
@ -219,9 +224,9 @@ class TDSql:
tdLog.info("dir: %s is empty, expect: empty" %dir)
else:
if state :
tdLog.info("dir: %s is empty, expect: not empty" %dir)
tdLog.info("dir: %s is not empty, expect: not empty" %dir)
else:
tdLog.exit("dir: %s is empty, expect: empty" %dir)
tdLog.exit("dir: %s is not empty, expect: empty" %dir)
else:
tdLog.exit("dir: %s doesn't exist" %dir)
def createDir(self, dir):