timeout as OK run

This commit is contained in:
Yakov Olkhovskiy 2024-10-22 12:25:15 +00:00
parent c52986bab7
commit d1426886e3
2 changed files with 11 additions and 11 deletions

View File

@ -177,7 +177,7 @@ def read_status(status_path: Path):
def process_results(result_path: Path):
test_results = []
oks = 0
timeouts = 0
errors = 0
fails = 0
for file in result_path.glob("*.status"):
fuzzer = file.stem
@ -188,8 +188,8 @@ def process_results(result_path: Path):
result = TestResult(fuzzer, status[0], float(status[2]))
if status[0] == "OK":
oks += 1
elif status[0] == "Timeout":
timeouts += 1
elif status[0] == "ERROR":
errors += 1
if file_path_out.exists():
result.set_log_files(f"['{file_path_out}']")
else:
@ -202,7 +202,7 @@ def process_results(result_path: Path):
result.set_log_files(f"['{file_path_out}']")
test_results.append(result)
return [oks, timeouts, fails, test_results]
return [oks, errors, fails, test_results]
def main():
@ -284,7 +284,7 @@ def main():
success = results[1] == 0 and results[2] == 0
JobReport(
description=f"OK: {results[0]}, Timeout: {results[1]}, FAIL: {results[2]}",
description=f"OK: {results[0]}, ERROR: {results[1]}, FAIL: {results[2]}",
test_results=results[3],
status=SUCCESS if success else FAILURE,
start_time=stopwatch.start_time_str,

View File

@ -117,17 +117,17 @@ def run_fuzzer(fuzzer: str, timeout: int):
f"FAIL\n{stopwatch.start_time_str}\n{stopwatch.duration_seconds}\n"
)
except subprocess.TimeoutExpired:
logging.info("Timeout running %s", fuzzer)
with open(status_path, "w", encoding="utf-8") as status:
status.write(
f"Timeout\n{stopwatch.start_time_str}\n{stopwatch.duration_seconds}\n"
)
else:
logging.info("Successful running %s", fuzzer)
with open(status_path, "w", encoding="utf-8") as status:
status.write(
f"OK\n{stopwatch.start_time_str}\n{stopwatch.duration_seconds}\n"
)
else:
logging.info("Error running %s", fuzzer)
with open(status_path, "w", encoding="utf-8") as status:
status.write(
f"ERROR\n{stopwatch.start_time_str}\n{stopwatch.duration_seconds}\n"
)
os.remove(out_path)