From ff3de654c83fd00b63fd9dea852e41a0f19c8b4a Mon Sep 17 00:00:00 2001 From: jingkl <34296482+jingkl@users.noreply.github.com> Date: Mon, 11 Jul 2022 19:24:26 +0800 Subject: [PATCH] [test]Add the testcase with index (#18226) Signed-off-by: jingkl --- build/ci/jenkins/Nightly.groovy | 1 + tests/python_client/testcases/test_index.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/build/ci/jenkins/Nightly.groovy b/build/ci/jenkins/Nightly.groovy index c6fb8f2766..a1f4d9a1eb 100644 --- a/build/ci/jenkins/Nightly.groovy +++ b/build/ci/jenkins/Nightly.groovy @@ -144,6 +144,7 @@ pipeline { --set dataNode.replicas=2 \ --set dataCoordinator.gc.missingTolerance=86400 \ --set dataCoordinator.gc.dropTolerance=86400 \ + --set indexCoordinator.gc.interval=1 \ --version ${chart_version} \ -f values/${mqMode}.yaml \ -f values/nightly.yaml " diff --git a/tests/python_client/testcases/test_index.py b/tests/python_client/testcases/test_index.py index f1a4347baf..46cc5a4023 100644 --- a/tests/python_client/testcases/test_index.py +++ b/tests/python_client/testcases/test_index.py @@ -978,6 +978,26 @@ class TestNewIndexBase(TestcaseBase): 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."}) + @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):