mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 20:09:57 +08:00
Add testcase with max field num (#13050)
* Add testcase with max field num Signed-off-by: jingkl <jingjing.jia@zilliz.com> * Add testcase with max field num Signed-off-by: jingkl <jingjing.jia@zilliz.com>
This commit is contained in:
parent
23e3a88a41
commit
0ac30342f6
@ -929,7 +929,49 @@ class TestCollectionParams(TestcaseBase):
|
||||
error = {ct.err_code: -1, ct.err_msg: f"expected one of: int, long"}
|
||||
self.collection_wrap.init_collection(c_name, schema=default_schema, shards_num=error_type_shards_num,
|
||||
check_task=CheckTasks.err_res,
|
||||
check_items=error)
|
||||
check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
def test_create_collection_maximum_fields(self):
|
||||
"""
|
||||
target: test create collection with maximum fields
|
||||
method: create collection with maximum field number
|
||||
expected: no exception
|
||||
"""
|
||||
self._connect()
|
||||
c_name = cf.gen_unique_str(prefix)
|
||||
int_fields=[]
|
||||
limit_num=254
|
||||
for i in range(limit_num):
|
||||
field_name =cf.gen_unique_str("field_name")
|
||||
field=cf.gen_int64_field(name=field_name)
|
||||
int_fields.append(field)
|
||||
int_fields.append(cf.gen_float_vec_field())
|
||||
int_fields.append(cf.gen_int64_field(is_primary=True))
|
||||
schema = cf.gen_collection_schema(fields=int_fields)
|
||||
self.collection_wrap.init_collection(c_name, schema=schema, check_task=CheckTasks.check_collection_property,
|
||||
check_items={exp_name: c_name, exp_schema: schema})
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
def test_create_collection_over_maximum_fields(self):
|
||||
"""
|
||||
target: Test create collection with more than the maximum fields
|
||||
method: create collection with more than the maximum field number
|
||||
expected: raise exception
|
||||
"""
|
||||
self._connect()
|
||||
c_name = cf.gen_unique_str(prefix)
|
||||
int_fields=[]
|
||||
limit_num=256
|
||||
for i in range(limit_num):
|
||||
field_name =cf.gen_unique_str("field_name")
|
||||
field=cf.gen_int64_field(name=field_name)
|
||||
int_fields.append(field)
|
||||
int_fields.append(cf.gen_float_vec_field())
|
||||
int_fields.append(cf.gen_int64_field(is_primary=True))
|
||||
schema = cf.gen_collection_schema(fields=int_fields)
|
||||
error = {ct.err_code: 1, ct.err_msg: "maximum field's number should be limited to 256"}
|
||||
self.collection_wrap.init_collection(c_name, schema=schema, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
|
||||
class TestCollectionOperation(TestcaseBase):
|
||||
|
Loading…
Reference in New Issue
Block a user