Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions src/clusterfuzz/_internal/bot/tasks/utasks/fuzz_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2205,8 +2205,9 @@ def run(self):
logs.info('Checking for bad build.')
crash_revision = environment.get_value('APP_REVISION')

build_data = testcase_manager.check_for_bad_build(self.job_type,
crash_revision)
with self.steps_time_tracker.track('bad_build_check'):
build_data = testcase_manager.check_for_bad_build(self.job_type,
crash_revision)
self.fuzz_task_output.build_data.CopyFrom(build_data)
_track_build_run_result(self.job_type, crash_revision,
build_data.is_bad_build)
Expand Down
5 changes: 5 additions & 0 deletions src/clusterfuzz/_internal/metrics/fuzzer_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
'type': 'INTERVAL',
'mode': 'NULLABLE',
},
{
'name': 'bad_build_check',
'type': 'INTERVAL',
'mode': 'NULLABLE',
},
]
JOB_RUN_SCHEMA = {
'fields': [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,9 @@ def test_utask_main_blackbox_fuzzer(self, mock_generate_blackbox_testcases):
self.assertGreater(
actual.fuzz_task_output.steps_duration['fuzzer_setup']
.ToTimedelta().total_seconds(), 0)
self.assertGreater(
actual.fuzz_task_output.steps_duration['bad_build_check']
.ToTimedelta().total_seconds(), 0)
self.assertGreater(
actual.fuzz_task_output.testcase_generation_duration.ToTimedelta()
.total_seconds(), 0)
Expand Down Expand Up @@ -1648,6 +1651,17 @@ def test_utask_main_blackbox_fuzzer(self, mock_generate_blackbox_testcases):
self.assertEqual(1, dist.count)
self.assertGreater(dist.sum, 0)

dist = monitoring_metrics.FUZZ_TASK_STEPS_DURATION.get({
'fuzzer': fuzzer.name,
'job': 'asan_test',
'platform': environment.platform(),
'runtime': environment.get_runtime().value,
'step': 'bad_build_check',
'success': True,
})
self.assertEqual(1, dist.count)
self.assertGreater(dist.sum, 0)

# Blackbox crashes are parsed once, after all testcases have run.
self.assertGreater(
actual.fuzz_task_output.steps_duration['parse_crash']
Expand Down