Skip to content

Commit

Permalink
[test]Add message for assert (milvus-io#19329)
Browse files Browse the repository at this point in the history
Signed-off-by: zhuwenxing <[email protected]>

Signed-off-by: zhuwenxing <[email protected]>
  • Loading branch information
zhuwenxing authored Sep 21, 2022
1 parent 10c0ff1 commit 4ef49e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/python_client/deploy/scripts/second_recall_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")


Expand Down
4 changes: 2 additions & 2 deletions tests/python_client/deploy/scripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand Down

0 comments on commit 4ef49e9

Please sign in to comment.