Skip to content

Commit

Permalink
Revert rearch PRs from today. (#4209)
Browse files Browse the repository at this point in the history
They should be working, but I be around to fix them.
  • Loading branch information
jonathanmetzman authored Aug 23, 2024
1 parent c168c88 commit 1b8ca0d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 47 deletions.
30 changes: 11 additions & 19 deletions src/clusterfuzz/_internal/bot/tasks/utasks/fuzz_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -1772,10 +1772,11 @@ def run(self):

build_data = testcase_manager.check_for_bad_build(self.job_type,
crash_revision)
self.fuzz_task_output.build_data = build_data
# TODO(https://github.com/google/clusterfuzz/issues/3008): Move this to
# postprocess.
testcase_manager.update_build_metadata(self.job_type, build_data)
_track_build_run_result(self.job_type, crash_revision,
build_data.is_bad_build)

if build_data.is_bad_build:
return uworker_msg_pb2.Output( # pylint: disable=no-member
error_type=uworker_msg_pb2.ErrorType.UNHANDLED) # pylint: disable=no-member
Expand Down Expand Up @@ -1893,8 +1894,6 @@ def postprocess(self, uworker_output):

_upload_testcase_run_jsons(
uworker_output.fuzz_task_output.testcase_run_jsons)
testcase_manager.update_build_metadata(
uworker_input.job_type, uworker_output.fuzz_task_output.build_data)


def _upload_testcase_run_jsons(testcase_run_jsons):
Expand Down Expand Up @@ -1928,19 +1927,6 @@ def utask_main(uworker_input):
return session.run()


def handle_fuzz_no_fuzz_target_selected(output):
save_fuzz_targets(output)
# Try again now that there are some fuzz targets.
utask_preprocess(output.uworker_input.fuzzer_name,
output.uworker_input.job_type,
output.uworker_input.uworker_env)


def handle_fuzz_bad_build(output):
testcase_manager.update_build_metadata(output.uworker_input.job_type,
output.fuzz_task_output.build_data)


def _make_session(uworker_input):
test_timeout = environment.get_value('TEST_TIMEOUT')
return FuzzingSession(
Expand All @@ -1949,6 +1935,14 @@ def _make_session(uworker_input):
)


def handle_fuzz_no_fuzz_target_selected(output):
save_fuzz_targets(output)
# Try again now that there are some fuzz targets.
utask_preprocess(output.uworker_input.fuzzer_name,
output.uworker_input.job_type,
output.uworker_input.uworker_env)


_ERROR_HANDLER = uworker_handle_errors.CompositeErrorHandler({
uworker_msg_pb2.ErrorType.FUZZ_BUILD_SETUP_FAILURE: # pylint: disable=no-member
handle_fuzz_build_setup_failure,
Expand All @@ -1958,8 +1952,6 @@ def _make_session(uworker_input):
handle_fuzz_no_fuzzer,
uworker_msg_pb2.ErrorType.FUZZ_NO_FUZZ_TARGET_SELECTED: # pylint: disable=no-member
handle_fuzz_no_fuzz_target_selected,
uworker_msg_pb2.ErrorType.FUZZ_BAD_BUILD: # pylint: disable=no-member
handle_fuzz_bad_build,
}).compose_with(uworker_handle_errors.UNHANDLED_ERROR_HANDLER)


Expand Down
2 changes: 0 additions & 2 deletions src/clusterfuzz/_internal/protos/uworker_msg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ message FuzzTaskOutput {
repeated string fuzz_targets = 11;
repeated string testcase_run_jsons = 12;
repeated FuzzTaskCrashGroup crash_groups = 13;
optional BuildData build_data = 14;
}

message MinimizeTaskOutput {
Expand Down Expand Up @@ -352,7 +351,6 @@ enum ErrorType {
FUZZ_DATA_BUNDLE_SETUP_FAILURE = 10;
FUZZ_NO_FUZZER = 11;
FUZZ_NO_FUZZ_TARGET_SELECTED = 13;
FUZZ_BAD_BUILD = 37;
PROGRESSION_REVISION_LIST_ERROR = 14;
PROGRESSION_BUILD_NOT_FOUND = 15;
PROGRESSION_NO_CRASH = 16;
Expand Down
Loading

0 comments on commit 1b8ca0d

Please sign in to comment.