Skip to content

Commit 26fa37a

Browse files
authored
Fix Analyze Task (#4441)
Fetching the testcase from the datastore has been wrongly moved before the call to `_update_testcase`. This leads to us holding an outdated version of the testcase.
1 parent 94d42ca commit 26fa37a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/clusterfuzz/_internal/bot/tasks/utasks/analyze_task.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -441,16 +441,15 @@ def utask_main(uworker_input):
441441

442442
test_for_reproducibility(fuzz_target, testcase, testcase_file_path, state,
443443
test_timeout)
444-
one_time_flag = testcase.one_time_crasher_flag
445444

446-
analyze_task_output.one_time_crasher_flag = one_time_flag
445+
analyze_task_output.one_time_crasher_flag = testcase.one_time_crasher_flag
447446

448447
monitoring_metrics.ANALYZE_TASK_REPRODUCIBILITY.increment(
449448
labels={
450449
'fuzzer_name': uworker_input.fuzzer_name,
451450
'job': uworker_input.job_type,
452451
'crashes': True,
453-
'reproducible': not one_time_flag,
452+
'reproducible': not testcase.one_time_crasher_flag,
454453
'platform': environment.platform(),
455454
})
456455

@@ -559,9 +558,6 @@ def _update_testcase(output):
559558
def utask_postprocess(output):
560559
"""Trusted: Cleans up after a uworker execute_task, writing anything needed to
561560
the db."""
562-
testcase = data_handler.get_testcase_by_id(output.uworker_input.testcase_id)
563-
testcase_upload_metadata = testcase_utils.get_testcase_upload_metadata(
564-
output.uworker_input.testcase_id)
565561
testcase_utils.emit_testcase_triage_duration_metric(
566562
int(output.uworker_input.testcase_id),
567563
testcase_utils.TESTCASE_TRIAGE_DURATION_ANALYZE_COMPLETED_STEP)
@@ -570,6 +566,10 @@ def utask_postprocess(output):
570566
_ERROR_HANDLER.handle(output)
571567
return
572568

569+
testcase = data_handler.get_testcase_by_id(output.uworker_input.testcase_id)
570+
testcase_upload_metadata = testcase_utils.get_testcase_upload_metadata(
571+
output.uworker_input.testcase_id)
572+
573573
log_message = (f'Testcase crashed in {output.test_timeout} seconds '
574574
f'(r{testcase.crash_revision})')
575575
data_handler.update_testcase_comment(testcase, data_types.TaskState.FINISHED,

0 commit comments

Comments
 (0)