From d1ee728376b5e5bb9de88e4278c042e1e04512b6 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 26 Jan 2021 16:53:17 +0800 Subject: [PATCH] fix psutil.process error --- tests/pytest/util/sql.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/pytest/util/sql.py b/tests/pytest/util/sql.py index adb49760bd..16931cca33 100644 --- a/tests/pytest/util/sql.py +++ b/tests/pytest/util/sql.py @@ -194,9 +194,13 @@ class TDSql: pstate = 0 pl = psutil.pids() for pid in pl: - if psutil.Process(pid).name() == 'taosd': - pstate = 1 - break + try: + if psutil.Process(pid).name() == 'taosd': + print('have already started') + pstate = 1 + break + except psutil.NoSuchProcess: + pass if pstate == state :break if state or pstate: tdLog.sleep(1) -- GitLab