@@ -1772,11 +1772,10 @@ def run(self):
1772
1772
1773
1773
build_data = testcase_manager .check_for_bad_build (self .job_type ,
1774
1774
crash_revision )
1775
- # TODO(https://github.com/google/clusterfuzz/issues/3008): Move this to
1776
- # postprocess.
1777
- testcase_manager .update_build_metadata (self .job_type , build_data )
1775
+ self .fuzz_task_output .build_data = build_data
1778
1776
_track_build_run_result (self .job_type , crash_revision ,
1779
1777
build_data .is_bad_build )
1778
+
1780
1779
if build_data .is_bad_build :
1781
1780
return uworker_msg_pb2 .Output ( # pylint: disable=no-member
1782
1781
error_type = uworker_msg_pb2 .ErrorType .UNHANDLED ) # pylint: disable=no-member
@@ -1896,6 +1895,8 @@ def postprocess(self, uworker_output):
1896
1895
1897
1896
_upload_testcase_run_jsons (
1898
1897
uworker_output .fuzz_task_output .testcase_run_jsons )
1898
+ testcase_manager .update_build_metadata (
1899
+ uworker_input .job_type , uworker_output .fuzz_task_output .build_data )
1899
1900
1900
1901
1901
1902
def _upload_testcase_run_jsons (testcase_run_jsons ):
@@ -1929,14 +1930,6 @@ def utask_main(uworker_input):
1929
1930
return session .run ()
1930
1931
1931
1932
1932
- def _make_session (uworker_input ):
1933
- test_timeout = environment .get_value ('TEST_TIMEOUT' )
1934
- return FuzzingSession (
1935
- uworker_input ,
1936
- test_timeout ,
1937
- )
1938
-
1939
-
1940
1933
def handle_fuzz_no_fuzz_target_selected (output ):
1941
1934
save_fuzz_targets (output )
1942
1935
# Try again now that there are some fuzz targets.
@@ -1945,6 +1938,19 @@ def handle_fuzz_no_fuzz_target_selected(output):
1945
1938
output .uworker_input .uworker_env )
1946
1939
1947
1940
1941
+ def handle_fuzz_bad_build (output ):
1942
+ testcase_manager .update_build_metadata (output .uworker_input .job_type ,
1943
+ output .fuzz_task_output .build_data )
1944
+
1945
+
1946
+ def _make_session (uworker_input ):
1947
+ test_timeout = environment .get_value ('TEST_TIMEOUT' )
1948
+ return FuzzingSession (
1949
+ uworker_input ,
1950
+ test_timeout ,
1951
+ )
1952
+
1953
+
1948
1954
_ERROR_HANDLER = uworker_handle_errors .CompositeErrorHandler ({
1949
1955
uworker_msg_pb2 .ErrorType .FUZZ_BUILD_SETUP_FAILURE : # pylint: disable=no-member
1950
1956
handle_fuzz_build_setup_failure ,
@@ -1954,6 +1960,8 @@ def handle_fuzz_no_fuzz_target_selected(output):
1954
1960
handle_fuzz_no_fuzzer ,
1955
1961
uworker_msg_pb2 .ErrorType .FUZZ_NO_FUZZ_TARGET_SELECTED : # pylint: disable=no-member
1956
1962
handle_fuzz_no_fuzz_target_selected ,
1963
+ uworker_msg_pb2 .ErrorType .FUZZ_BAD_BUILD : # pylint: disable=no-member
1964
+ handle_fuzz_bad_build ,
1957
1965
}).compose_with (uworker_handle_errors .UNHANDLED_ERROR_HANDLER )
1958
1966
1959
1967
0 commit comments