From 93fa40a7893a8a83a43c84c87315a313b9e2b885 Mon Sep 17 00:00:00 2001 From: yanliang567 <82361606+yanliang567@users.noreply.github.com> Date: Sat, 16 Oct 2021 21:57:36 +0800 Subject: [PATCH] search with guarantee_timestamp instead of sleep to wait (#10006) Signed-off-by: yanliang567 --- tests/python_client/testcases/test_search_20.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/python_client/testcases/test_search_20.py b/tests/python_client/testcases/test_search_20.py index fbc090469..97f47fc45 100644 --- a/tests/python_client/testcases/test_search_20.py +++ b/tests/python_client/testcases/test_search_20.py @@ -474,8 +474,10 @@ class TestCollectionSearchInvalid(TestcaseBase): target: test search with empty connection method: 1. search the empty collection before load 2. search the empty collection after load + 3. search collection with data inserted but not load again expected: 1. raise exception if not loaded 2. return topk=0 if loaded + 3. return topk successfully """ # 1. initialize without data collection_w = self.init_collection_general(prefix)[0] @@ -499,11 +501,9 @@ class TestCollectionSearchInvalid(TestcaseBase): # 4. search with data inserted but not load again data = cf.gen_default_dataframe_data(nb=2000) insert_res, _ = collection_w.insert(data) - sleep(0.2) - # insert_ids = [] - # insert_ids.extend(insert_res.primary_keys) collection_w.search(vectors[:default_nq], default_search_field, default_search_params, default_limit, default_search_exp, + guarantee_timestamp=insert_res.timestamp + 1, check_task=CheckTasks.check_search_results, check_items={"nq": default_nq, "ids": insert_res.primary_keys, -- GitLab