未验证 提交 55627761 编写于 作者: T ThreadDao 提交者: GitHub

[skip ci] Test chaos memory stress querynode (#11018)

Signed-off-by: NThreadDao <yufen.zong@zilliz.com>
上级 b96b7733
......@@ -15,4 +15,5 @@ spec:
stressors:
memory:
workers: 4
size: 1000MB
\ No newline at end of file
size: 512Mi
duration: 5m
\ No newline at end of file
......@@ -57,37 +57,28 @@ class TestChaosData:
6. release and reload collection, verify search and query is available
expected: after chaos deleted, load, search and query qre both available
"""
c_name = cf.gen_unique_str('chaos_memory')
collection_w = construct_from_data(c_name)
c_name = 'chaos_memory_nx6DNW4q'
collection_w = ApiCollectionWrapper()
collection_w.init_collection(c_name)
log.debug(collection_w.schema)
log.debug(collection_w._shards_num)
# apply memory stress
apply_memory_stress(chaos_yaml)
# apply_memory_stress(chaos_yaml)
# wait memory stress
sleep(constants.WAIT_PER_OP * 2)
# query
collection_w.release()
collection_w.load()
term_expr = f'{ct.default_int64_field_name} in [0, 1, 999, 99]'
t0 = datetime.datetime.now()
query_res, _ = collection_w.query(term_expr)
tt = datetime.datetime.now() - t0
log.info(f"assert query: {tt}")
assert len(query_res) == 4
sleep(constants.WAIT_PER_OP * 5)
# sleep(constants.WAIT_PER_OP * 2)
# query
collection_w.release()
collection_w.load()
term_expr = f'{ct.default_int64_field_name} in [0, 1, 999, 99]'
t0 = datetime.datetime.now()
query_res, _ = collection_w.query(term_expr)
tt = datetime.datetime.now() - t0
log.info(f"assert query: {tt}")
assert len(query_res) == 4
for i in range(4):
t0_query = datetime.datetime.now()
query_res, _ = collection_w.query(term_expr)
tt_query = datetime.datetime.now() - t0_query
log.info(f"{i} query cost: {tt_query}")
assert len(query_res) == 4
@pytest.mark.tags(CaseLabel.L3)
@pytest.mark.parametrize('chaos_yaml', get_chaos_yamls())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册