From 93b0151b47a183d002af5cbd75ba8dbe6c78f03b Mon Sep 17 00:00:00 2001 From: Bowen Liang Date: Thu, 12 Jun 2025 21:57:13 +0800 Subject: [PATCH] update --- .github/workflows/vdb-tests.yml | 5 ++-- .../vdb/oceanbase/check_oceanbase_ready.py | 24 ++----------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/.github/workflows/vdb-tests.yml b/.github/workflows/vdb-tests.yml index 6696704f0a..a41f65db25 100644 --- a/.github/workflows/vdb-tests.yml +++ b/.github/workflows/vdb-tests.yml @@ -34,7 +34,6 @@ jobs: - name: Free Disk Space uses: endersonmenezes/free-disk-space@v2 with: - remove_android: true remove_dotnet: true - name: Setup UV and Python @@ -65,7 +64,7 @@ jobs: tidb tiflash - - name: Set up Vector Stores (Weaviate, Qdrant, PGVector, Milvus, PgVecto-RS, Chroma, MyScale, ElasticSearch, Couchbase) + - name: Set up Vector Stores (Weaviate, Qdrant, PGVector, Milvus, PgVecto-RS, Chroma, MyScale, ElasticSearch, Couchbase, OceanBase) uses: hoverkraft-tech/compose-action@v2.0.2 with: compose-file: | @@ -82,7 +81,7 @@ jobs: elasticsearch oceanbase - - name: Check TiDB, Oceanbase Ready + - name: Check VDB Ready (TiDB, Oceanbase) run: | uv run --project api python api/tests/integration_tests/vdb/tidb_vector/check_tiflash_ready.py uv run --project api python api/tests/integration_tests/vdb/oceanbase/check_oceanbase_ready.py diff --git a/api/tests/integration_tests/vdb/oceanbase/check_oceanbase_ready.py b/api/tests/integration_tests/vdb/oceanbase/check_oceanbase_ready.py index 0f8356cfd9..180ad57a15 100644 --- a/api/tests/integration_tests/vdb/oceanbase/check_oceanbase_ready.py +++ b/api/tests/integration_tests/vdb/oceanbase/check_oceanbase_ready.py @@ -1,4 +1,3 @@ -import logging import time import pymysql @@ -11,29 +10,10 @@ def check_ocean_ready() -> bool: port=2881, user="root", password="difyai123456", - connect_timeout=15, - read_timeout=20, - autocommit=True, ) - connection.ping(reconnect=True) - a = connection.query("select 1") - print(f"Oceanbase query result: {a}") - if a == 1: - return True - else: - return False - - # with connection.cursor() as cursor: - # # SELECT 1; - # # """ - # # cursor.execute(select_query) - # # result = cursor.fetchall() - # # return result is not None and len(result) > 0 - # cursor.execute("SELECT 1") - # return cursor.fetchone() is not None - + affected_rows = connection.query("SELECT 1") + return affected_rows == 1 except Exception as e: - logging.exception("Error checking OceanBase readiness") print(f"Oceanbase is not ready. Exception: {e}") return False finally: