diff --git a/api/tests/integration_tests/vdb/tidb_vector/check_tiflash_ready.py b/api/tests/integration_tests/vdb/tidb_vector/check_tiflash_ready.py index f76700aa0e..35c16a380d 100644 --- a/api/tests/integration_tests/vdb/tidb_vector/check_tiflash_ready.py +++ b/api/tests/integration_tests/vdb/tidb_vector/check_tiflash_ready.py @@ -4,6 +4,7 @@ import pymysql def check_tiflash_ready() -> bool: + connection = None try: connection = pymysql.connect( host="localhost", @@ -28,7 +29,10 @@ def check_tiflash_ready() -> bool: return False finally: if connection: - connection.close() + try: + connection.close() + except Exception: + pass def main():