Skip to content

Commit

Permalink
Fix assignment issue and typos (#3665)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmetzman authored Jan 23, 2024
1 parent 5b3a313 commit 644052f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
29 changes: 14 additions & 15 deletions src/clusterfuzz/_internal/bot/tasks/utasks/fuzz_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -1324,11 +1324,6 @@ def __init__(self, uworker_input, test_timeout):
self.gcs_corpus = None
self.fuzz_task_output = uworker_msg_pb2.FuzzTaskOutput()

def _get_output(self, **kwargs):
for k, v in kwargs.items():
setattr(self.fuzz_task_output, k, v)
return uworker_msg_pb2.Output(fuzz_task_output=self.fuzz_task_output)

@property
def fully_qualified_fuzzer_name(self):
"""Get the fully qualified fuzzer name."""
Expand Down Expand Up @@ -1907,16 +1902,20 @@ def run(self):

if new_targets_count is not None:
self.fuzz_task_output.new_targets_count = new_targets_count
return self._get_output(
fully_qualified_fuzzer_name=self.fully_qualified_fuzzer_name,
crash_revision=str(crash_revision),
job_run_timestamp=time.time(),
new_crash_count=new_crash_count,
known_crash_count=known_crash_count,
testcases_executed=testcases_executed,
job_run_crashes=convert_groups_to_crashes(processed_groups),
fuzzer_revision=self.fuzzer.revision,
)

self.fuzz_task_output.fully_qualified_fuzzer_name = (
self.fully_qualified_fuzzer_name)
self.fuzz_task_output.crash_revision = str(crash_revision)
self.fuzz_task_output.job_run_timestamp = time.time()
self.fuzz_task_output.new_crash_count = new_crash_count
self.fuzz_task_output.known_crash_count = known_crash_count
self.fuzz_task_output.testcases_executed = testcases_executed
self.fuzz_task_output.fuzzer_revision = self.fuzzer.revision
if job_run_crashes:
job_run_crashes = convert_groups_to_crashes(processed_groups)
self.fuzz_task_output.job_run_crashes.extend(job_run_crashes)

return uworker_msg_pb2.Output(fuzz_task_output=self.fuzz_task_output)

def postprocess(self, uworker_output):
"""Handles postprocessing."""
Expand Down
4 changes: 2 additions & 2 deletions src/clusterfuzz/_internal/bot/tasks/utasks/minimize_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ def _skip_minimization(testcase: data_types.Testcase,
def handle_libfuzzer_minimization_unreproducible(
output: uworker_msg_pb2.Output):
"""Handles libfuzzer minimization task's failure to reproduce the issue."""
testcase = data_handler.get_testcase_by_id(output.uworker_intput.testcase_id)
testcase = data_handler.get_testcase_by_id(output.uworker_input.testcase_id)
# Be more lenient with marking testcases as unreproducible when this is a
# job override.
is_overriden_job = bool(environment.get_value('ORIGINAL_JOB_NAME'))
Expand All @@ -1414,7 +1414,7 @@ def handle_libfuzzer_minimization_unreproducible(

def handle_libfuzzer_minimization_failed(output: uworker_msg_pb2.Output):
"""Handles libfuzzer minimization task failure."""
testcase = data_handler.get_testcase_by_id(output.uworker_intput.testcase_id)
testcase = data_handler.get_testcase_by_id(output.uworker_input.testcase_id)
_skip_minimization(
testcase,
'LibFuzzer minimization failed',
Expand Down
2 changes: 2 additions & 0 deletions src/python/bot/startup/run_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def schedule_utask_mains():
if not utask_mains:
return

logs.log(f'Combining {len(utask_mains)} batch tasks.')

batch_tasks = []
with lease_all_tasks(utask_mains):
batch_tasks = [
Expand Down

0 comments on commit 644052f

Please sign in to comment.