You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fluss.apache.org by yu...@apache.org on 2026/04/17 11:24:36 UTC

(fluss-rust) branch main updated: [ci/cd] fix python tests with more strict scoping (#494)

This is an automated email from the ASF dual-hosted git repository.

yuxia pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss-rust.git


The following commit(s) were added to refs/heads/main by this push:
     new be4e2d1  [ci/cd] fix python tests with more strict scoping (#494)
be4e2d1 is described below

commit be4e2d1270b94a2e01c68d5ce407f5571e28d97f
Author: Anton Borisov <14...@users.noreply.github.com>
AuthorDate: Fri Apr 17 12:24:30 2026 +0100

    [ci/cd] fix python tests with more strict scoping (#494)
---
 bindings/python/pyproject.toml   |  4 ++--
 bindings/python/test/conftest.py | 16 ++++++++++------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/bindings/python/pyproject.toml b/bindings/python/pyproject.toml
index 9163835..22e6418 100644
--- a/bindings/python/pyproject.toml
+++ b/bindings/python/pyproject.toml
@@ -95,8 +95,8 @@ known-first-party = ["fluss"]
 
 [tool.pytest.ini_options]
 asyncio_mode = "auto"
-asyncio_default_fixture_loop_scope = "session"
-timeout = 30
+asyncio_default_fixture_loop_scope = "function"
+timeout = 120
 
 [tool.mypy]
 python_version = "3.9"
diff --git a/bindings/python/test/conftest.py b/bindings/python/test/conftest.py
index 7da0f3d..47c9280 100644
--- a/bindings/python/test/conftest.py
+++ b/bindings/python/test/conftest.py
@@ -124,12 +124,16 @@ def fluss_cluster():
     yield (plaintext_addr, sasl_addr or plaintext_addr)
 
 
-@pytest_asyncio.fixture(scope="session")
+_cached_connection = None
+
+
+@pytest_asyncio.fixture
 async def connection(fluss_cluster):
-    plaintext_addr, _sasl_addr = fluss_cluster
-    conn = await _connect(plaintext_addr)
-    yield conn
-    conn.close()
+    global _cached_connection
+    if _cached_connection is None:
+        plaintext_addr, _sasl_addr = fluss_cluster
+        _cached_connection = await _connect(plaintext_addr)
+    yield _cached_connection
 
 
 @pytest.fixture(scope="session")
@@ -144,6 +148,6 @@ def plaintext_bootstrap_servers(fluss_cluster):
     return plaintext_addr
 
 
-@pytest_asyncio.fixture(scope="session")
+@pytest_asyncio.fixture
 async def admin(connection):
     return connection.get_admin()