[test] Add case load partition names empty (#21087)

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
pull/21134/head
ThreadDao 2022-12-12 10:11:20 +08:00 committed by GitHub
parent 0faf24cc54
commit 18ef74007f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 1 deletions

View File

@ -2171,7 +2171,7 @@ class TestLoadCollection(TestcaseBase):
collection_wr.load(check_task=CheckTasks.err_res, check_items=error)
collection_wr.release(check_task=CheckTasks.err_res, check_items=error)
@pytest.mark.tags(CaseLabel.L0)
@pytest.mark.tags(CaseLabel.L2)
def test_release_collection_after_drop(self):
"""
target: test release collection after drop
@ -2188,6 +2188,33 @@ class TestLoadCollection(TestcaseBase):
ct.err_msg: "can't find collection"}
collection_wr.release(check_task=CheckTasks.err_res, check_items=error)
@pytest.mark.tags(CaseLabel.L1)
def test_load_partition_names_empty(self):
"""
target: test query another partition
method: 1. insert entities into two partitions
2.query on one partition and query result empty
expected: query result is empty
"""
self._connect()
collection_w = self.init_collection_wrap(name=cf.gen_unique_str(prefix))
partition_w = self.init_partition_wrap(collection_wrap=collection_w)
# insert [0, half) into partition_w
half = ct.default_nb // 2
df_partition = cf.gen_default_dataframe_data(nb=half)
partition_w.insert(df_partition)
# insert [half, nb) into _default
df_default = cf.gen_default_dataframe_data(nb=half, start=half)
collection_w.insert(df_default)
# flush
collection_w.num_entities
collection_w.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index)
# load
error = {ct.err_code: 0, ct.err_msg: "due to no partition specified"}
collection_w.load(partition_names=[], check_task=CheckTasks.err_res, check_items=error)
@pytest.mark.tags(CaseLabel.L0)
def test_load_partitions_release_collection(self):
"""