未验证 提交 4ef49e9d 编写于 作者: Z zhuwenxing 提交者: GitHub

[test]Add message for assert (#19329)

Signed-off-by: Nzhuwenxing <wenxing.zhu@zilliz.com>
Signed-off-by: Nzhuwenxing <wenxing.zhu@zilliz.com>
上级 10c0ff12
......@@ -47,11 +47,11 @@ def search_test(host="127.0.0.1"):
sum_radio = 0.0
for index, item in enumerate(result_ids):
# tmp = set(item).intersection(set(flat_id_list[index]))
assert len(item) == len(true_ids[index])
assert len(item) == len(true_ids[index]), f"get {len(item)} but expect {len(true_ids[index])}"
tmp = set(true_ids[index]).intersection(set(item))
sum_radio = sum_radio + len(tmp) / len(item)
recall = round(sum_radio / len(result_ids), 3)
assert recall >= 0.95
assert recall >= 0.95, f"recall is {recall}, less than 0.95"
print(f"recall={recall}")
......
......@@ -167,9 +167,9 @@ def load_and_search(prefix, replicas=1):
# Get value of the random value field for search result
print(hit, hit.entity.get("random_value"))
ids = hits.ids
assert len(ids) == topK
assert len(ids) == topK, f"get {len(ids)} results, but topK is {topK}"
print(ids)
assert len(res) == len(v_search)
assert len(res) == len(v_search), f"get {len(res)} results, but search num is {len(v_search)}"
print("search latency: %.4fs" % (end_time - start_time))
t0 = time.time()
expr = "count in [2,4,6,8]"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册