mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
test: refine debug log and error handle (#30406)
refine debug log and error handle --------- Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
parent
e677af19b0
commit
b02b525196
@ -34,7 +34,7 @@ def get_chaos_info():
|
|||||||
with open(constants.CHAOS_INFO_SAVE_PATH, 'r') as f:
|
with open(constants.CHAOS_INFO_SAVE_PATH, 'r') as f:
|
||||||
chaos_info = json.load(f)
|
chaos_info = json.load(f)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(f"get_chaos_info error: {e}")
|
log.warn(f"get_chaos_info error: {e}")
|
||||||
return None
|
return None
|
||||||
return chaos_info
|
return chaos_info
|
||||||
|
|
||||||
@ -106,7 +106,11 @@ class RequestRecords(metaclass=Singleton):
|
|||||||
def sink(self):
|
def sink(self):
|
||||||
if len(self.buffer) == 0:
|
if len(self.buffer) == 0:
|
||||||
return
|
return
|
||||||
|
try:
|
||||||
df = pd.DataFrame(self.buffer)
|
df = pd.DataFrame(self.buffer)
|
||||||
|
except Exception as e:
|
||||||
|
log.error(f"convert buffer {self.buffer} to dataframe error: {e}")
|
||||||
|
return
|
||||||
if not self.created_file:
|
if not self.created_file:
|
||||||
with request_lock:
|
with request_lock:
|
||||||
df.to_parquet(self.file_name, engine='fastparquet')
|
df.to_parquet(self.file_name, engine='fastparquet')
|
||||||
@ -187,7 +191,7 @@ class ResultAnalyzer:
|
|||||||
def show_result_table(self):
|
def show_result_table(self):
|
||||||
table = PrettyTable()
|
table = PrettyTable()
|
||||||
table.field_names = ['operation_name', 'before_chaos',
|
table.field_names = ['operation_name', 'before_chaos',
|
||||||
f'during_chaos\n{self.chaos_start_time}~{self.recovery_time}',
|
f'during_chaos: {self.chaos_start_time}~{self.recovery_time}',
|
||||||
'after_chaos']
|
'after_chaos']
|
||||||
data = self.get_stage_success_rate()
|
data = self.get_stage_success_rate()
|
||||||
for operation, values in data.items():
|
for operation, values in data.items():
|
||||||
@ -380,7 +384,6 @@ class Checker:
|
|||||||
offset_ts = int(time.time() * self.scale)
|
offset_ts = int(time.time() * self.scale)
|
||||||
ts_data.append(offset_ts)
|
ts_data.append(offset_ts)
|
||||||
data[0] = ts_data # set timestamp (ms) as int64
|
data[0] = ts_data # set timestamp (ms) as int64
|
||||||
log.debug(f"insert data: {ts_data}")
|
|
||||||
res, result = self.c_wrap.insert(data=data,
|
res, result = self.c_wrap.insert(data=data,
|
||||||
partition_name=partition_name,
|
partition_name=partition_name,
|
||||||
timeout=timeout,
|
timeout=timeout,
|
||||||
|
|||||||
@ -26,7 +26,7 @@ def get_all_collections():
|
|||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
all_collections = data["all"]
|
all_collections = data["all"]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(f"get_all_collections error: {e}")
|
log.warn(f"get_all_collections error: {e}")
|
||||||
return [None]
|
return [None]
|
||||||
return all_collections
|
return all_collections
|
||||||
|
|
||||||
|
|||||||
@ -105,9 +105,9 @@ fi
|
|||||||
# Run concurrent test with 10 processes
|
# Run concurrent test with 10 processes
|
||||||
if [[ -n "${TEST_TIMEOUT:-}" ]]; then
|
if [[ -n "${TEST_TIMEOUT:-}" ]]; then
|
||||||
|
|
||||||
timeout "${TEST_TIMEOUT}" pytest testcases/test_concurrent.py --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} --count 10 -n 10 \
|
timeout "${TEST_TIMEOUT}" pytest testcases/test_concurrent.py --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} --count 5 -n 5 \
|
||||||
--html=${CI_LOG_PATH}/report_concurrent.html --self-contained-html
|
--html=${CI_LOG_PATH}/report_concurrent.html --self-contained-html
|
||||||
else
|
else
|
||||||
pytest testcases/test_concurrent.py --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} --count 10 -n 10 \
|
pytest testcases/test_concurrent.py --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} --count 5 -n 5 \
|
||||||
--html=${CI_LOG_PATH}/report_concurrent.html --self-contained-html
|
--html=${CI_LOG_PATH}/report_concurrent.html --self-contained-html
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user