Modify test case about replica number (#22251)

Signed-off-by: nico <cheng.yuan@zilliz.com>
pull/22252/head
NicoYuan1986 2023-02-18 09:40:28 +08:00 committed by GitHub
parent 8c6a2a35d7
commit 9ea4c509c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -2228,11 +2228,11 @@ class TestLoadCollection(TestcaseBase):
collection_w.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index)
# load with non-number replicas
error = {ct.err_code: 0, ct.err_msg: f"but expected one of: int, long"}
error = {ct.err_code: 1, ct.err_msg: f"but expected one of: int, long"}
collection_w.load(replica_number=get_non_number_replicas, check_task=CheckTasks.err_res, check_items=error)
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("replicas", [-1, 0, None])
@pytest.mark.parametrize("replicas", [-1, 0])
def test_load_replica_invalid_number(self, replicas):
"""
target: test load partition with invalid replica number

View File

@ -329,17 +329,17 @@ class TestPartitionParams(TestcaseBase):
partition_w.insert(cf.gen_default_list_data(nb=100))
# load with non-number replicas
error = {ct.err_code: 0, ct.err_msg: f"but expected one of: int, long"}
error = {ct.err_code: 1, ct.err_msg: f"but expected one of: int, long"}
collection_w.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index)
partition_w.load(replica_number=get_non_number_replicas, check_task=CheckTasks.err_res, check_items=error)
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("replicas", [0, -1, None])
@pytest.mark.parametrize("replicas", [0, -1])
def test_load_replica_invalid_number(self, replicas):
"""
target: test load partition with invalid replica number
method: load with invalid replica number
expected: raise exception
expected: load successfully as replica = 1
"""
# create, insert
self._connect()