From a03f921de32cad2a6953a34a51b8668155a9e584 Mon Sep 17 00:00:00 2001 From: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:41:04 -0500 Subject: [PATCH] Support postprocessing in OSS-Fuzz (#4388) --- src/clusterfuzz/_internal/base/tasks/__init__.py | 3 ++- src/clusterfuzz/_internal/base/tasks/task_utils.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/clusterfuzz/_internal/base/tasks/__init__.py b/src/clusterfuzz/_internal/base/tasks/__init__.py index 41c0d5a027..e57c739a24 100644 --- a/src/clusterfuzz/_internal/base/tasks/__init__.py +++ b/src/clusterfuzz/_internal/base/tasks/__init__.py @@ -281,7 +281,8 @@ def is_done_collecting_messages(): def get_postprocess_task(): """Gets a postprocess task if one exists.""" # This should only be run on non-preemptible bots. - if not task_utils.is_remotely_executing_utasks(): + if not (task_utils.is_remotely_executing_utasks() or + task_utils.get_opted_in_tasks()): return None # Postprocess is platform-agnostic, so we run all such tasks on our # most generic and plentiful bots only. In other words, we avoid diff --git a/src/clusterfuzz/_internal/base/tasks/task_utils.py b/src/clusterfuzz/_internal/base/tasks/task_utils.py index 692b8cd5ca..9b001aab5a 100644 --- a/src/clusterfuzz/_internal/base/tasks/task_utils.py +++ b/src/clusterfuzz/_internal/base/tasks/task_utils.py @@ -37,12 +37,16 @@ def is_remotely_executing_utasks(task=None) -> bool: return is_task_opted_into_uworker_execution(task) +def get_opted_in_tasks(): + return local_config.ProjectConfig().get('uworker_tasks', []) + + def is_task_opted_into_uworker_execution(task): # TODO(metzman): Remove this after OSS-Fuzz and Chrome are at parity. - uworker_tasks = local_config.ProjectConfig().get('uworker_tasks', []) if 'skia' not in environment.get_value('JOB_NAME', ''): # This is just for testing OSS-Fuzz. return False + uworker_tasks = get_opted_in_tasks() return task in uworker_tasks