From 308e68972d3fcedb9f20de14e2192e0260698d6c Mon Sep 17 00:00:00 2001 From: cpwu Date: Wed, 20 Jul 2022 14:30:37 +0800 Subject: [PATCH] fix socket assert --- tests/pytest/util/taosadapter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/pytest/util/taosadapter.py b/tests/pytest/util/taosadapter.py index 844c58fa6c..1a198240d7 100644 --- a/tests/pytest/util/taosadapter.py +++ b/tests/pytest/util/taosadapter.py @@ -183,12 +183,16 @@ class TAdapter: s.settimeout(3) try: res = s.connect_ex((self.remoteIP, taosadapter_port)) + s.shutdown(2) if res == 0: tdLog.info(f"the taosadapter has been started, using port:{taosadapter_port}") else: tdLog.info(f"the taosadapter do not started!!!") except socket.error as e: tdLog.notice("socket connect error!") + finally: + if s: + s.close() # tdLog.debug("the taosadapter has been started.") time.sleep(1)