From cbba9c4517de533a34e7cde718602f099d214f79 Mon Sep 17 00:00:00 2001 From: del-zhenwu <56623710+del-zhenwu@users.noreply.github.com> Date: Fri, 11 Jun 2021 03:00:55 -0500 Subject: [PATCH] add case for max length search result (#5737) * add case Signed-off-by: zw * add case Signed-off-by: zw Co-authored-by: zw --- tests/milvus_python_test/entity/test_search.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/milvus_python_test/entity/test_search.py b/tests/milvus_python_test/entity/test_search.py index 8231352dd5..9dc05a8fd2 100644 --- a/tests/milvus_python_test/entity/test_search.py +++ b/tests/milvus_python_test/entity/test_search.py @@ -155,6 +155,20 @@ class TestSearchBase: else: assert not status.OK() + @pytest.mark.level(2) + def test_search_top_max_nq(self, connect, collection): + ''' + target: test basic search fuction, assert fail if nq * topk is larger than max_value + method: search with the given vectors, topk * nq * 12 > 2GB + expected: search failed + ''' + nq = 12000 + vectors, ids = self.init_data(connect, collection, nb=100000) + query_vec = [vectors[0] for i in range(nq)] + top_k = 16384 + status, result = connect.search(collection, top_k, query_vec) + assert not status.OK() + def test_search_top_k_flat_index_metric_type(self, connect, collection): ''' target: test basic search fuction, all the search params is corrent, change top-k value