mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
[test]Update the method for check insert number (#24289)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
parent
d8a3b9d07e
commit
f73f4d5ff1
@ -41,7 +41,8 @@ class TestAllCollection(TestcaseBase):
|
||||
log.info(f"assert create collection: {tt}, init_entities: {entities}")
|
||||
|
||||
# insert
|
||||
data = cf.gen_default_list_data()
|
||||
insert_batch = 3000
|
||||
data = cf.gen_default_list_data(start=-insert_batch)
|
||||
t0 = time.time()
|
||||
_, res = collection_w.insert(data)
|
||||
tt = time.time() - t0
|
||||
@ -52,7 +53,7 @@ class TestAllCollection(TestcaseBase):
|
||||
t0 = time.time()
|
||||
_, check_result = collection_w.flush(timeout=180)
|
||||
assert check_result
|
||||
assert collection_w.num_entities == len(data[0]) + entities
|
||||
# assert collection_w.num_entities == len(data[0]) + entities
|
||||
tt = time.time() - t0
|
||||
entities = collection_w.num_entities
|
||||
log.info(f"assert flush: {tt}, entities: {entities}")
|
||||
@ -86,6 +87,13 @@ class TestAllCollection(TestcaseBase):
|
||||
tt = time.time() - t0
|
||||
log.info(f"assert search: {tt}")
|
||||
assert len(res_1) == 1
|
||||
# query
|
||||
term_expr = f'{ct.default_int64_field_name} in {[i for i in range(-insert_batch,0)]}'
|
||||
t0 = time.time()
|
||||
res, _ = collection_w.query(term_expr)
|
||||
tt = time.time() - t0
|
||||
log.info(f"assert query result {len(res)}: {tt}")
|
||||
assert len(res) >= insert_batch
|
||||
collection_w.release()
|
||||
|
||||
# insert data
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user