From a9da437d024f91293fbc35ba95093e1a6986f5c7 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 26 Jan 2021 16:06:16 +0800 Subject: [PATCH] fix some error in python test frame --- tests/pytest/util/sql.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/pytest/util/sql.py b/tests/pytest/util/sql.py index 4f7607fc6c..adb49760bd 100644 --- a/tests/pytest/util/sql.py +++ b/tests/pytest/util/sql.py @@ -194,11 +194,12 @@ class TDSql: pstate = 0 pl = psutil.pids() for pid in pl: - if psutil.Process(pid).name == 'taosd': + if psutil.Process(pid).name() == 'taosd': pstate = 1 break - if pstate: - tdLog.sleep(5) + if pstate == state :break + if state or pstate: + tdLog.sleep(1) continue pstate = 0 break @@ -219,9 +220,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): -- GitLab