add case for max length search result (#5737)

* add case

Signed-off-by: zw <zw@milvus.io>

* add case

Signed-off-by: zw <zw@milvus.io>

Co-authored-by: zw <zw@milvus.io>
This commit is contained in:
del-zhenwu 2021-06-11 03:00:55 -05:00 committed by GitHub
parent f6f57c203a
commit cbba9c4517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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