Skip to content

Commit 09a2ad4

Browse files
authored
Deal with accuracy data missing scenario (#2976)
1 parent cabd624 commit 09a2ad4

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

tools/run_tests.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def run_accuracy(gpu_id, start, index, count):
335335

336336
if code == TIMEOUT: # Timeout
337337
return {
338-
"status": "TIMEOUT",
338+
"status": "Timeout",
339339
"exit_code": TIMEOUT,
340340
"total": 0,
341341
"passed": 0,
@@ -345,6 +345,21 @@ def run_accuracy(gpu_id, start, index, count):
345345
"duration": end - start,
346346
}
347347

348+
# There are rare cases where the pytest process aborts
349+
# with no result file generated.
350+
if not result_file.exists:
351+
return {
352+
"status": "Error",
353+
"exit_code": code,
354+
"total": 0,
355+
"passed": 0,
356+
"failed": 0,
357+
"skipped": 0,
358+
"errors": 1,
359+
"duration": end - start,
360+
"data_file": None,
361+
}
362+
348363
op_dir = OUTPUT_DIR.joinpath(op)
349364
dest = op_dir / "accuracy_result.json"
350365
shutil.move(result_file, str(dest))

0 commit comments

Comments
 (0)