mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
test: update cases for error message (#39960)
Signed-off-by: nico <cheng.yuan@zilliz.com>
This commit is contained in:
parent
0c74e409df
commit
9a8d94998a
@ -137,8 +137,8 @@ class TestMilvusClientCollectionInvalid(TestMilvusClientV2Base):
|
||||
client = self._client()
|
||||
collection_name = cf.gen_unique_str(prefix)
|
||||
# 1. create collection
|
||||
error = {ct.err_code: 65535, ct.err_msg: f"type param(max_length) should be specified for the "
|
||||
f"field({default_primary_key_field_name}) of collection {collection_name}"}
|
||||
error = {ct.err_code: 65535, ct.err_msg: f"type param(max_length) should be specified for "
|
||||
f"varChar field(id) of collection {collection_name}"}
|
||||
self.create_collection(client, collection_name, default_dim, id_type="string", auto_id=True,
|
||||
check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
|
||||
@ -608,11 +608,13 @@ class TestAsyncMilvusClientPartitionInvalid(TestMilvusClientV2Base):
|
||||
check_task=CheckTasks.err_res, check_items=error)
|
||||
partition_name = ""
|
||||
error = {ct.err_code: 200, ct.err_msg: f"partition not found[partition={partition_name}]"}
|
||||
await async_client.release_partitions(collection_name, partition_name,
|
||||
check_task=CheckTasks.err_res, check_items=error)
|
||||
# await async_client.release_partitions(collection_name, partition_name,
|
||||
# check_task=CheckTasks.err_res, check_items=error)
|
||||
# https://github.com/milvus-io/milvus/issues/38223
|
||||
# 3. drop action
|
||||
await async_client.drop_collection(collection_name)
|
||||
|
||||
|
||||
class TestAsyncMilvusClientPartitionValid(TestMilvusClientV2Base):
|
||||
""" Test case of partition interface """
|
||||
|
||||
|
||||
@ -3134,16 +3134,21 @@ class TestDescribeCollection(TestcaseBase):
|
||||
description = \
|
||||
{'collection_name': c_name, 'auto_id': False, 'num_shards': ct.default_shards_num, 'description': '',
|
||||
'fields': [
|
||||
{'field_id': 100, 'name': 'int64', 'description': '', 'type': 5, 'params': {}, 'is_primary': True},
|
||||
{'field_id': 101, 'name': 'float', 'description': '', 'type': 10, 'params': {}},
|
||||
{'field_id': 102, 'name': 'varchar', 'description': '', 'type': 21, 'params': {'max_length': 65535}},
|
||||
{'field_id': 103, 'name': 'json_field', 'description': '', 'type': 23, 'params': {}},
|
||||
{'field_id': 104, 'name': 'float_vector', 'description': '', 'type': 101, 'params': {'dim': 128}}
|
||||
{'field_id': 100, 'name': 'int64', 'description': '', 'type': DataType.INT64, 'params': {},
|
||||
'is_primary': True},
|
||||
{'field_id': 101, 'name': 'float', 'description': '', 'type': DataType.FLOAT, 'params': {}},
|
||||
{'field_id': 102, 'name': 'varchar', 'description': '', 'type': DataType.VARCHAR,
|
||||
'params': {'max_length': 65535}},
|
||||
{'field_id': 103, 'name': 'json_field', 'description': '', 'type': DataType.JSON, 'params': {}},
|
||||
{'field_id': 104, 'name': 'float_vector', 'description': '', 'type': DataType.FLOAT_VECTOR,
|
||||
'params': {'dim': 128}}
|
||||
],
|
||||
'functions': [], 'aliases': [], 'consistency_level': 0, 'properties': {},
|
||||
'num_partitions': 1, 'enable_dynamic_field': False}
|
||||
res = collection_w.describe()[0]
|
||||
assert isinstance(res['collection_id'], int) and isinstance(res['created_timestamp'], int)
|
||||
del res['collection_id']
|
||||
del res['created_timestamp']
|
||||
log.info(res)
|
||||
assert description == res
|
||||
|
||||
|
||||
@ -2212,7 +2212,8 @@ class TestScaNNIndex(TestcaseBase):
|
||||
collection_w = self.init_collection_general(prefix, is_index=False, dim=dim)[0]
|
||||
index_params = {"index_type": "SCANN", "metric_type": "L2", "params": {"nlist": 1024}}
|
||||
error = {ct.err_code: 1100,
|
||||
ct.err_msg: f"The dimension of a vector (dim) should be a multiple of 2. Dimension:{dim}"}
|
||||
ct.err_msg: f"The dimension of a vector (dim) should be a multiple of sub_dim. "
|
||||
f"Dimension:{dim}, sub_dim:2: invalid parameter"}
|
||||
collection_w.create_index(default_field_name, index_params,
|
||||
check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
|
||||
@ -1775,7 +1775,7 @@ class TestQueryParams(TestcaseBase):
|
||||
collection_w.insert(data)
|
||||
|
||||
# 3. query with param ignore_growing invalid
|
||||
error = {ct.err_code: 999, ct.err_msg: "parse search growing failed"}
|
||||
error = {ct.err_code: 999, ct.err_msg: "parse ignore growing field failed"}
|
||||
collection_w.query('int64 >= 0', ignore_growing=ignore_growing,
|
||||
check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
|
||||
@ -1037,13 +1037,12 @@ class TestCollectionSearchInvalid(TestcaseBase):
|
||||
|
||||
# 3. search with param ignore_growing=True
|
||||
search_params = {"metric_type": "L2", "params": {"nprobe": 10}, "ignore_growing": ignore_growing}
|
||||
vector = [[random.random() for _ in range(default_dim)]
|
||||
for _ in range(nq)]
|
||||
vector = [[random.random() for _ in range(default_dim)] for _ in range(nq)]
|
||||
collection_w.search(vector[:default_nq], default_search_field, search_params, default_limit,
|
||||
default_search_exp,
|
||||
check_task=CheckTasks.err_res,
|
||||
check_items={"err_code": 999,
|
||||
"err_msg": "parse search growing failed"})
|
||||
"err_msg": "parse ignore growing field failed"})
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
def test_search_param_invalid_guarantee_timestamp(self, get_invalid_guarantee_timestamp):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user