diff options
author | Yu-Ju Hong <yjhong@chromium.org> | 2014-11-05 11:47:10 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-11-06 21:14:47 +0000 |
commit | b7d47f70b4285475e0722de47d4a14cf6bc22a50 (patch) | |
tree | a1e0766b4d2326c3540675237a7838bdcc6d1f8e /cbuildbot/stages/sync_stages_unittest.py | |
parent | b7304b4b6723d5bc61550b4d9c11d34dc15db92e (diff) | |
download | chromite-b7d47f70b4285475e0722de47d4a14cf6bc22a50.tar.gz |
Move setting builder status to inflight to the end of the stage
This is desirable for the reasons below:
1. When a slave fails midway through the sync stage, we often
have to delete the status file in GS in order to relaunch
the slave. By moving the status change to the end of the
stage, we avoid hitting this situation again.
2. If a builder did not start ("inflight" was never set), we
consider it an infrastructure failure. If the builder set
status to inflight then timed out, we think the CLs may be
at fault. However, as mentioned in (1), we have sync failures
often due to gerrit/git problems, which are valid infra
failures. Moving the status change to the end of the stage
helps CQ categorize the failure more accurately.
3. CQ slave records CLs it picks up in the sync stage. If the
build fails before the recording completes, we can detect that
the pickup information is inaccurate (and should not be used)
if the builder status is not set.
BUG=chromium:422639
TEST=`cbuildbot/run_tests`
Change-Id: I23e9999b016baea7d40cf62ef77b85057a7d4f33
Reviewed-on: https://chromium-review.googlesource.com/227654
Tested-by: Yu-Ju Hong <yjhong@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Yu-Ju Hong <yjhong@chromium.org>
Diffstat (limited to 'cbuildbot/stages/sync_stages_unittest.py')
-rwxr-xr-x | cbuildbot/stages/sync_stages_unittest.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cbuildbot/stages/sync_stages_unittest.py b/cbuildbot/stages/sync_stages_unittest.py index 91220b2ee..2c073f541 100755 --- a/cbuildbot/stages/sync_stages_unittest.py +++ b/cbuildbot/stages/sync_stages_unittest.py @@ -57,6 +57,7 @@ class ManifestVersionedSyncStageTest(generic_stages_unittest.AbstractStageTest): self.incr_type = 'branch' self.next_version = 'next_version' self.sync_stage = None + self.PatchObject(manifest_version.BuildSpecsManager, 'SetInFlight') repo = repository.RepoRepository( self.source_repo, self.tempdir, self.branch) @@ -91,7 +92,6 @@ class ManifestVersionedSyncStageTest(generic_stages_unittest.AbstractStageTest): sync_stages.ManifestVersionedSyncStage.Initialize() self.manager.GetNextBuildSpec( build_id=MOCK_BUILD_ID, - dashboard_url=self.sync_stage.ConstructDashboardURL() ).AndReturn(self.next_version) self.manager.GetLatestPassingSpec().AndReturn(None) @@ -138,6 +138,7 @@ class BaseCQTestCase(generic_stages_unittest.StageTest): """Setup patchers for specified bot id.""" # Mock out methods as needed. self.PatchObject(lkgm_manager, 'GenerateBlameList') + self.PatchObject(lkgm_manager.LKGMManager, 'SetInFlight') self.PatchObject(repository.RepoRepository, 'ExportManifest', return_value=self.MANIFEST_CONTENTS, autospec=True) self.StartPatcher(git_unittest.ManifestMock()) |