[test]Add the testcase with index (#18226)

Signed-off-by: jingkl <jingjing.jia@zilliz.com>
This commit is contained in:
jingkl 2022-07-11 19:24:26 +08:00 committed by GitHub
parent 064e104d05
commit ff3de654c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -144,6 +144,7 @@ pipeline {
--set dataNode.replicas=2 \ --set dataNode.replicas=2 \
--set dataCoordinator.gc.missingTolerance=86400 \ --set dataCoordinator.gc.missingTolerance=86400 \
--set dataCoordinator.gc.dropTolerance=86400 \ --set dataCoordinator.gc.dropTolerance=86400 \
--set indexCoordinator.gc.interval=1 \
--version ${chart_version} \ --version ${chart_version} \
-f values/${mqMode}.yaml \ -f values/${mqMode}.yaml \
-f values/nightly.yaml " -f values/nightly.yaml "

View File

@ -978,6 +978,26 @@ class TestNewIndexBase(TestcaseBase):
collection_w.drop_index(index_name=default_field_name, check_task=CheckTasks.err_res, collection_w.drop_index(index_name=default_field_name, check_task=CheckTasks.err_res,
check_items={ct.err_code: 0, ct.err_msg: "Index doesn\'t exist."}) check_items={ct.err_code: 0, ct.err_msg: "Index doesn\'t exist."})
@pytest.mark.tags(CaseLabel.L1)
def test_index_collection_with_after_load(self):
"""
target: Test that index files are not lost after loading
method: create collection and add entities in it, create index, flush and load
expected: load and search successfully
"""
collection_w = self.init_collection_wrap(cf.gen_unique_str(prefix))
nums = 20
tmp_nb = 5000
for i in range (nums) :
df = cf.gen_default_dataframe_data(nb=tmp_nb, start=i * tmp_nb)
insert_res, _ = collection_w.insert(df)
assert collection_w.num_entities ==(i+1) * tmp_nb
collection_w.create_index(ct.default_float_vec_field_name, default_index_params)
collection_w.load()
vectors = [[random.random() for _ in range(default_dim)] for _ in range(default_nq)]
search_res, _ = collection_w.search(vectors, default_search_field, default_search_params, default_limit)
assert len(search_res[0]) == ct.default_limit
class TestNewIndexBinary(TestcaseBase): class TestNewIndexBinary(TestcaseBase):