Fix db push for stresstest and timetests (#13964)

* Fix db push

* Fix log info for new data

* Check if file exists

* Remove _id field

* Add error message print
This commit is contained in:
Smirnova Maria
2022-11-17 13:52:21 +02:00
committed by GitHub
parent 0a08cfe2d6
commit 5cf6ceaf83
4 changed files with 25 additions and 11 deletions

View File

@@ -79,18 +79,20 @@ def run_timetest(args: dict, log=None):
for run_iter in range(args["niter"]):
tmp_stats_path = tempfile.NamedTemporaryFile().name
retcode, msg = cmd_exec(cmd_common + ["-s", str(tmp_stats_path)], log=log)
if os.path.exists(tmp_stats_path):
with open(tmp_stats_path, "r") as file:
logs.append(file.read())
if retcode != 0:
log.error(f"Run of executable '{args['executable']}' failed with return code '{retcode}'. Error: {msg}\n"
f"Statistics aggregation is skipped.")
return retcode, msg, {}, {}
return retcode, msg, {}, {}, logs
# Read raw statistics
with open(tmp_stats_path, "r") as file:
raw_data = list(yaml.load_all(file, Loader=yaml.SafeLoader))
with open(tmp_stats_path, "r") as file:
logs.append(file.read())
os.unlink(tmp_stats_path)
# Parse raw data