From d84d06814c5836554103c654b28a3e5c7bb41a58 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 26 Jan 2021 16:51:00 +0800 Subject: [PATCH] fix psutil.procsee 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 4f7607fc6c..e20515140e 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: tdLog.sleep(5) continue -- GitLab