From 1c3abbb052da85d7aefa9c72dbe222c7a1eaf643 Mon Sep 17 00:00:00 2001 From: ThreadDao Date: Mon, 17 Jan 2022 15:37:35 +0800 Subject: [PATCH] Update pymilvus version and consistency import (#15226) Signed-off-by: ThreadDao --- tests/python_client/base/collection_wrapper.py | 4 ++-- tests/python_client/conftest.py | 9 +++++---- tests/python_client/requirements.txt | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/python_client/base/collection_wrapper.py b/tests/python_client/base/collection_wrapper.py index 079d237982..58d18aa4c1 100644 --- a/tests/python_client/base/collection_wrapper.py +++ b/tests/python_client/base/collection_wrapper.py @@ -7,7 +7,7 @@ sys.path.append("..") from check.func_check import ResponseChecker from utils.api_request import api_request from utils.util_log import test_log as log -from pymilvus.grpc_gen.common_pb2 import ConsistencyLevel +from pymilvus.orm.types import CONSISTENCY_STRONG TIMEOUT = 20 @@ -20,7 +20,7 @@ class ApiCollectionWrapper: collection = None def init_collection(self, name, schema=None, using="default", shards_num=2, check_task=None, check_items=None, **kwargs): - consistency_level = kwargs.get("consistency_level", ConsistencyLevel.Strong) + consistency_level = kwargs.get("consistency_level", CONSISTENCY_STRONG) kwargs.update({"consistency_level": consistency_level}) """ In order to distinguish the same name of collection """ diff --git a/tests/python_client/conftest.py b/tests/python_client/conftest.py index 2cdca796f1..ece41d343f 100644 --- a/tests/python_client/conftest.py +++ b/tests/python_client/conftest.py @@ -11,6 +11,7 @@ from base.client_base import param_info from check.param_check import ip_check, number_check from config.log_config import log_config from utils.util_pymilvus import get_milvus, gen_unique_str, gen_default_fields, gen_binary_default_fields +from pymilvus.orm.types import CONSISTENCY_STRONG timeout = 60 dimension = 128 @@ -363,7 +364,7 @@ def collection(request, connect): log.debug(f'collection_name: {collection_name}') try: default_fields = gen_default_fields() - connect.create_collection(collection_name, default_fields) + connect.create_collection(collection_name, default_fields, consistency_level=CONSISTENCY_STRONG) except Exception as e: pytest.exit(str(e)) @@ -384,7 +385,7 @@ def id_collection(request, connect): log.debug(f'id_collection_name: {collection_name}') try: fields = gen_default_fields(auto_id=False) - connect.create_collection(collection_name, fields) + connect.create_collection(collection_name, fields, consistency_level=CONSISTENCY_STRONG) except Exception as e: pytest.exit(str(e)) @@ -403,7 +404,7 @@ def binary_collection(request, connect): collection_name = gen_unique_str(ori_collection_name) try: fields = gen_binary_default_fields() - connect.create_collection(collection_name, fields) + connect.create_collection(collection_name, fields, consistency_level=CONSISTENCY_STRONG) except Exception as e: pytest.exit(str(e)) @@ -424,7 +425,7 @@ def binary_id_collection(request, connect): collection_name = gen_unique_str(ori_collection_name) try: fields = gen_binary_default_fields(auto_id=False) - connect.create_collection(collection_name, fields) + connect.create_collection(collection_name, fields, consistency_level=CONSISTENCY_STRONG) except Exception as e: pytest.exit(str(e)) diff --git a/tests/python_client/requirements.txt b/tests/python_client/requirements.txt index b0b44a08cd..c054cdae31 100644 --- a/tests/python_client/requirements.txt +++ b/tests/python_client/requirements.txt @@ -12,7 +12,7 @@ allure-pytest==2.7.0 pytest-print==0.2.1 pytest-level==0.1.1 pytest-xdist==2.2.1 -pymilvus==2.0.0rc10.dev5 +pymilvus==2.0.0rc10.dev7 pytest-rerunfailures==9.1.1 git+https://github.com/Projectplace/pytest-tags ndg-httpsclient