Fix get segment info testcase (#12232)

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
zhuwenxing 2021-11-23 21:09:16 +08:00 committed by GitHub
parent 653369ee63
commit 1dfdb32254
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1380,20 +1380,25 @@ class TestUtilityAdvanced(TestcaseBase):
assert len(res) == 0
@pytest.mark.tags(CaseLabel.L1)
def test_get_query_segment_info(self):
def test_get_growing_query_segment_info(self):
"""
target: test getting query segment info of collection with data
method: init a collection, insert data and get query segment info
expected:
method: init a collection, insert data, load, search, and get query segment info
expected:
1. length of segment is greater than 0
2. the sum num_rows of each segment is equal to num of entities
"""
import random
dim = 128
c_name = cf.gen_unique_str(prefix)
collection_w = self.init_collection_wrap(name=c_name)
nb = 3000
nq = 2
df = cf.gen_default_dataframe_data(nb)
collection_w.insert(df)
collection_w.load()
collection_w.load()
vectors = [[random.random() for _ in range(dim)] for _ in range(nq)]
collection_w.search(vectors, default_field_name, ct.default_search_params, ct.default_limit)
res, _ = self.utility_wrap.get_query_segment_info(c_name)
assert len(res) > 0
cnt = 0