mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 03:48:37 +08:00
[test]Add the testcase with index (#18226)
Signed-off-by: jingkl <jingjing.jia@zilliz.com>
This commit is contained in:
parent
064e104d05
commit
ff3de654c8
@ -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 "
|
||||||
|
@ -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):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user