Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle deleted fuzz targets in split builds #4410

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
8 changes: 7 additions & 1 deletion src/clusterfuzz/_internal/build_management/build_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,13 @@ def _setup_split_targets_build(bucket_path, fuzz_target, revision=None):
bucket_path = environment.get_value('FUZZ_TARGET_BUILD_BUCKET_PATH')
if not fuzz_target:
raise BuildManagerError(
'Failed to choose a fuzz target (path=%s).' % bucket_path)
f'Failed to choose a fuzz target (path={bucket_path}).')

# Check this so that we handle deleted targets properly.
targets_list = _get_targets_list(bucket_path)
if fuzz_target not in targets_list:
raise errors.BuildNotFoundError(revision, environment.get_value('JOB_NAME'))

fuzz_target_bucket_path = _full_fuzz_target_path(bucket_path, fuzz_target)
if not revision:
revision = _get_latest_revision([fuzz_target_bucket_path])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1741,6 +1741,9 @@ def test_target_no_longer_built(self):
build_manager._pick_random_fuzz_target_for_split_build(
target_weights={'target4': 1})

with self.assertRaises(errors.BuildNotFoundError):
build_manager.setup_build(fuzz_target='target4')


class GetPrimaryBucketPathTest(unittest.TestCase):
"""Tests for get_primary_bucket_path."""
Expand Down
Loading