From 97da6bd7e35d9f2c6b9efeff6bb78eee1970623a Mon Sep 17 00:00:00 2001 From: jac Date: Tue, 25 Nov 2025 11:01:07 +0800 Subject: [PATCH] test: Increase PyMilvus version to 2.7.0rc72 for master branch and fix async teardown logic (#45809) Signed-off-by: silas.jiang Co-authored-by: silas.jiang --- tests/python_client/requirements.txt | 4 ++-- .../async_milvus_client/test_collection_async.py | 10 ++++------ .../testcases/async_milvus_client/test_e2e_async.py | 5 ++--- .../testcases/async_milvus_client/test_index_async.py | 10 ++++------ .../async_milvus_client/test_partition_async.py | 10 ++++------ 5 files changed, 16 insertions(+), 23 deletions(-) diff --git a/tests/python_client/requirements.txt b/tests/python_client/requirements.txt index 803f61cdf9..d10f27fb0f 100644 --- a/tests/python_client/requirements.txt +++ b/tests/python_client/requirements.txt @@ -28,8 +28,8 @@ pytest-parallel pytest-random-order # pymilvus -pymilvus==2.7.0rc60 -pymilvus[bulk_writer]==2.7.0rc60 +pymilvus==2.7.0rc72 +pymilvus[bulk_writer]==2.7.0rc72 # for protobuf protobuf>=5.29.5 diff --git a/tests/python_client/testcases/async_milvus_client/test_collection_async.py b/tests/python_client/testcases/async_milvus_client/test_collection_async.py index 4143f6970a..8f3219a433 100644 --- a/tests/python_client/testcases/async_milvus_client/test_collection_async.py +++ b/tests/python_client/testcases/async_milvus_client/test_collection_async.py @@ -31,9 +31,8 @@ class TestAsyncMilvusClientCollectionInvalid(TestMilvusClientV2Base): """ Test case of collection interface """ def teardown_method(self, method): - self.init_async_milvus_client() - loop = asyncio.get_event_loop() - loop.run_until_complete(self.async_milvus_client_wrap.close()) + if self.async_milvus_client_wrap.async_milvus_client is not None: + asyncio.run(self.async_milvus_client_wrap.close()) super().teardown_method(method) """ @@ -128,9 +127,8 @@ class TestAsyncMilvusClientCollectionValid(TestMilvusClientV2Base): """ Test case of collection interface """ def teardown_method(self, method): - self.init_async_milvus_client() - loop = asyncio.get_event_loop() - loop.run_until_complete(self.async_milvus_client_wrap.close()) + if self.async_milvus_client_wrap.async_milvus_client is not None: + asyncio.run(self.async_milvus_client_wrap.close()) super().teardown_method(method) """ diff --git a/tests/python_client/testcases/async_milvus_client/test_e2e_async.py b/tests/python_client/testcases/async_milvus_client/test_e2e_async.py index 1ca8e2f44e..6c8815c9c5 100644 --- a/tests/python_client/testcases/async_milvus_client/test_e2e_async.py +++ b/tests/python_client/testcases/async_milvus_client/test_e2e_async.py @@ -21,9 +21,8 @@ default_vector_name = "vector" class TestAsyncMilvusClient(TestMilvusClientV2Base): def teardown_method(self, method): - self.init_async_milvus_client() - loop = asyncio.get_event_loop() - loop.run_until_complete(self.async_milvus_client_wrap.close()) + if self.async_milvus_client_wrap.async_milvus_client is not None: + asyncio.run(self.async_milvus_client_wrap.close()) super().teardown_method(method) @pytest.mark.tags(CaseLabel.L0) diff --git a/tests/python_client/testcases/async_milvus_client/test_index_async.py b/tests/python_client/testcases/async_milvus_client/test_index_async.py index 2d6b3db9c3..1a482077cf 100644 --- a/tests/python_client/testcases/async_milvus_client/test_index_async.py +++ b/tests/python_client/testcases/async_milvus_client/test_index_async.py @@ -30,9 +30,8 @@ class TestAsyncMilvusClientIndexInvalid(TestMilvusClientV2Base): """ Test case of index interface """ def teardown_method(self, method): - self.init_async_milvus_client() - loop = asyncio.get_event_loop() - loop.run_until_complete(self.async_milvus_client_wrap.close()) + if self.async_milvus_client_wrap.async_milvus_client is not None: + asyncio.run(self.async_milvus_client_wrap.close()) super().teardown_method(method) """ @@ -206,9 +205,8 @@ class TestAsyncMilvusClientIndexValid(TestMilvusClientV2Base): """ Test case of index interface """ def teardown_method(self, method): - self.init_async_milvus_client() - loop = asyncio.get_event_loop() - loop.run_until_complete(self.async_milvus_client_wrap.close()) + if self.async_milvus_client_wrap.async_milvus_client is not None: + asyncio.run(self.async_milvus_client_wrap.close()) super().teardown_method(method) @pytest.fixture(scope="function", params=["COSINE", "L2", "IP"]) diff --git a/tests/python_client/testcases/async_milvus_client/test_partition_async.py b/tests/python_client/testcases/async_milvus_client/test_partition_async.py index 7dbba506c3..f894e933e8 100644 --- a/tests/python_client/testcases/async_milvus_client/test_partition_async.py +++ b/tests/python_client/testcases/async_milvus_client/test_partition_async.py @@ -31,9 +31,8 @@ class TestAsyncMilvusClientPartitionInvalid(TestMilvusClientV2Base): """ Test case of partition interface """ def teardown_method(self, method): - self.init_async_milvus_client() - loop = asyncio.get_event_loop() - loop.run_until_complete(self.async_milvus_client_wrap.close()) + if self.async_milvus_client_wrap.async_milvus_client is not None: + asyncio.run(self.async_milvus_client_wrap.close()) super().teardown_method(method) """ @@ -582,9 +581,8 @@ class TestAsyncMilvusClientPartitionValid(TestMilvusClientV2Base): """ Test case of partition interface """ def teardown_method(self, method): - self.init_async_milvus_client() - loop = asyncio.get_event_loop() - loop.run_until_complete(self.async_milvus_client_wrap.close()) + if self.async_milvus_client_wrap.async_milvus_client is not None: + asyncio.run(self.async_milvus_client_wrap.close()) super().teardown_method(method) """