diff --git a/infra/cifuzz/fuzz_target.py b/infra/cifuzz/fuzz_target.py index c51ca29e9..5a5ca5189 100644 --- a/infra/cifuzz/fuzz_target.py +++ b/infra/cifuzz/fuzz_target.py @@ -38,7 +38,10 @@ LIBFUZZER_OPTIONS_NO_REPORT_OOM = ['-rss_limit_mb=0'] # The number of reproduce attempts for a crash. REPRODUCE_ATTEMPTS = 10 -REPRODUCE_TIME_SECONDS = 30 +DEFAULT_REPRODUCE_TIME_SECONDS = 30 +PER_LANGUAGE_REPRODUCE_TIMEOUTS = { + 'python': 30 * 4 # Python takes a bit longer on startup. +} MINIMIZE_TIME_SECONDS = 60 * 4 # Seconds on top of duration until a timeout error is raised. @@ -284,13 +287,15 @@ class FuzzTarget: # pylint: disable=too-many-instance-attributes with clusterfuzz.environment.Environment(config_utils.DEFAULT_ENGINE, self.config.sanitizer, target_path): + reproduce_time_seconds = PER_LANGUAGE_REPRODUCE_TIMEOUTS.get( + self.config.language, DEFAULT_REPRODUCE_TIME_SECONDS) for _ in range(REPRODUCE_ATTEMPTS): engine_impl = clusterfuzz.fuzz.get_engine(config_utils.DEFAULT_ENGINE) try: result = engine_impl.reproduce(target_path, testcase, arguments=reproduce_args, - max_time=REPRODUCE_TIME_SECONDS) + max_time=reproduce_time_seconds) except TimeoutError as error: logging.error('%s.', error) return False