mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
fix style
This commit is contained in:
parent
f5a99dde86
commit
ae71f1070f
@ -122,7 +122,7 @@ def run_fuzzer(fuzzer: str, timeout: int):
|
|||||||
custom_libfuzzer_options = " ".join(
|
custom_libfuzzer_options = " ".join(
|
||||||
f"-{key}={value}"
|
f"-{key}={value}"
|
||||||
for key, value in parser["libfuzzer"].items()
|
for key, value in parser["libfuzzer"].items()
|
||||||
if key != "jobs" and key != "exact_artifact_path"
|
if key not in ('jobs', 'exact_artifact_path')
|
||||||
)
|
)
|
||||||
|
|
||||||
if parser.has_section("fuzzer_arguments"):
|
if parser.has_section("fuzzer_arguments"):
|
||||||
@ -153,9 +153,10 @@ def run_fuzzer(fuzzer: str, timeout: int):
|
|||||||
|
|
||||||
stopwatch = Stopwatch()
|
stopwatch = Stopwatch()
|
||||||
try:
|
try:
|
||||||
|
with open(out_path, "wb") as out:
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
cmd_line,
|
cmd_line,
|
||||||
stderr=open(out_path, "w"),
|
stderr=out,
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
text=True,
|
text=True,
|
||||||
check=True,
|
check=True,
|
||||||
@ -166,19 +167,25 @@ def run_fuzzer(fuzzer: str, timeout: int):
|
|||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
# print("Command failed with error:", e)
|
# print("Command failed with error:", e)
|
||||||
logging.info("Stderr output: %s", e.stderr)
|
logging.info("Stderr output: %s", e.stderr)
|
||||||
with open(status_path, "w") as status:
|
with open(status_path, "wb") as status:
|
||||||
status.write(f"FAIL\n{stopwatch.start_time_str}\n{stopwatch.duration_seconds}\n")
|
status.write(
|
||||||
|
f"FAIL\n{stopwatch.start_time_str}\n{stopwatch.duration_seconds}\n"
|
||||||
|
)
|
||||||
except subprocess.TimeoutExpired as e:
|
except subprocess.TimeoutExpired as e:
|
||||||
logging.info("Timeout for %s", cmd_line)
|
logging.info("Timeout for %s", cmd_line)
|
||||||
kill_fuzzer(fuzzer)
|
kill_fuzzer(fuzzer)
|
||||||
sleep(10)
|
sleep(10)
|
||||||
process_fuzzer_output(e.stderr)
|
process_fuzzer_output(e.stderr)
|
||||||
with open(status_path,"w") as status:
|
with open(status_path,"wb") as status:
|
||||||
status.write(f"Timeout\n{stopwatch.start_time_str}\n{stopwatch.duration_seconds}\n")
|
status.write(
|
||||||
|
f"Timeout\n{stopwatch.start_time_str}\n{stopwatch.duration_seconds}\n"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
process_fuzzer_output(result.stderr)
|
process_fuzzer_output(result.stderr)
|
||||||
with open(status_path,"w") as status:
|
with open(status_path,"wb") as status:
|
||||||
status.write(f"OK\n{stopwatch.start_time_str}\n{stopwatch.duration_seconds}\n")
|
status.write(
|
||||||
|
f"OK\n{stopwatch.start_time_str}\n{stopwatch.duration_seconds}\n"
|
||||||
|
)
|
||||||
|
|
||||||
s3.upload_build_directory_to_s3(
|
s3.upload_build_directory_to_s3(
|
||||||
Path(new_corpus_dir), f"fuzzer/corpus/{fuzzer}", False
|
Path(new_corpus_dir), f"fuzzer/corpus/{fuzzer}", False
|
||||||
|
Loading…
Reference in New Issue
Block a user