Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking fuzzing time on engine fuzzers #4356

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/clusterfuzz/_internal/bot/tasks/utasks/fuzz_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -1495,9 +1495,13 @@ def do_engine_fuzzing(self, engine_impl):
for fuzzing_round in range(environment.get_value('MAX_TESTCASES', 1)):
logs.info(f'Fuzzing round {fuzzing_round}.')
try:
result, current_fuzzer_metadata, fuzzing_strategies = run_engine_fuzzer(
engine_impl, self.fuzz_target.binary, sync_corpus_directory,
self.testcase_directory)
with _TrackFuzzTime(self.fully_qualified_fuzzer_name,
self.job_type) as tracker:
result, cur_fuzzer_metadata, fuzzing_strategies = run_engine_fuzzer(
engine_impl, self.fuzz_target.binary, sync_corpus_directory,
self.testcase_directory)
# Timeouts are only accounted for in libfuzzer, this can be None
tracker.timeout = bool(result.timed_out)
except FuzzTargetNotFoundError:
# Ocassionally fuzz targets are deleted. This is pretty rare. Since
# ClusterFuzz did nothing wrong, don't bubble up an exception, consider
Expand All @@ -1507,7 +1511,7 @@ def do_engine_fuzzing(self, engine_impl):
logs.error(f'{self.fuzz_target.binary} is not in the build.')
return [], {}

fuzzer_metadata.update(current_fuzzer_metadata)
fuzzer_metadata.update(cur_fuzzer_metadata)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to avoid linting failure due to a line too long


# Prepare stats.
testcase_run = engine_common.get_testcase_run(result.stats,
Expand Down Expand Up @@ -2045,8 +2049,7 @@ def _to_engine_output(output: str, return_code: int,
def _upload_engine_output_log(engine_output):
timestamp = uworker_io.proto_timestamp_to_timestamp(engine_output.timestamp)
testcase_manager.upload_log(engine_output.output.decode(),
engine_output.return_code,
timestamp)
engine_output.return_code, timestamp)


def utask_postprocess(output):
Expand Down
Loading