mirror of https://github.com/milvus-io/milvus.git
Add more cases to test shard_num valid range (#18965)
Signed-off-by: “nico” <cheng.yuan@zilliz.com> Signed-off-by: “nico” <cheng.yuan@zilliz.com>pull/18975/head
parent
05c724ad6d
commit
3cf6cf3802
|
@ -902,8 +902,8 @@ class TestCollectionParams(TestcaseBase):
|
|||
check_items={exp_name: c_name, exp_shards_num: default_shards_num})
|
||||
assert c_name in self.utility_wrap.list_collections()[0]
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L0)
|
||||
@pytest.mark.parametrize("shards_num", [-256, 0, 10, 256])
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
@pytest.mark.parametrize("shards_num", [-256, 0, 1, 10, 214, 256])
|
||||
def test_collection_shards_num_with_not_default_value(self, shards_num):
|
||||
"""
|
||||
target:test collection with shards_num
|
||||
|
@ -917,6 +917,20 @@ class TestCollectionParams(TestcaseBase):
|
|||
check_items={exp_name: c_name, exp_shards_num: shards_num})
|
||||
assert c_name in self.utility_wrap.list_collections()[0]
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
@pytest.mark.parametrize("shards_num", [257])
|
||||
def test_collection_shards_num_invalid(self, shards_num):
|
||||
"""
|
||||
target:test collection with invalid shards_num
|
||||
method:create collection with shards_num out of [1,256]
|
||||
expected: raise exception
|
||||
"""
|
||||
self._connect()
|
||||
c_name = cf.gen_unique_str(prefix)
|
||||
error = {ct.err_code: 1, ct.err_msg: "maximum shards's number should be limited to 256"}
|
||||
self.collection_wrap.init_collection(c_name, schema=default_schema, shards_num=shards_num,
|
||||
check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
def test_collection_shards_num_with_error_type(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue