diff options
author | Yu-Ju Hong <yjhong@chromium.org> | 2014-09-17 12:00:27 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-09-18 03:01:10 +0000 |
commit | 0c25f4039cf6368bcef0488d87016d1a02e61bf4 (patch) | |
tree | d8ec09700f1e6b573c329aac95a4e5dc28e4868b /cbuildbot | |
parent | d1105b3619afbe22df4a54b5059cb47525926a82 (diff) | |
download | chromite-0c25f4039cf6368bcef0488d87016d1a02e61bf4.tar.gz |
Build slaves do not need to fetch their status from GS or cidb
The build slaves already now their own statuses. Before, the slaves
fetch the status from Google Storage mostly because they can use the
same code path that the master runs. Now that we use the master build
id to query slave statuses, the slaves can no longer reuse the
code. Instead of fetching the status from GS or querying cidb, just
get the results locally.
BUG=chromium:412845
TEST=`cbuildbot/run_tests`
Change-Id: Iafc9e81f8dfc2101aa2b08cbc8df0296f5db6539
Reviewed-on: https://chromium-review.googlesource.com/218702
Tested-by: Yu-Ju Hong <yjhong@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: Yu-Ju Hong <yjhong@chromium.org>
Diffstat (limited to 'cbuildbot')
-rw-r--r-- | cbuildbot/stages/completion_stages.py | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/cbuildbot/stages/completion_stages.py b/cbuildbot/stages/completion_stages.py index 2c41c804a..a2255a60d 100644 --- a/cbuildbot/stages/completion_stages.py +++ b/cbuildbot/stages/completion_stages.py @@ -155,20 +155,11 @@ class MasterSlaveSyncCompletionStage(ManifestVersionedSyncCompletionStage): will have a BuilderStatus with status MISSING. """ if not self._run.config.master: - # This is a slave build, so return the status for this build. - if self._run.options.debug: - # In debug mode, nothing is uploaded to Google Storage, so we bypass - # the extra hop and just look at what we have locally. - status = manifest_version.BuilderStatus.GetCompletedStatus(self.success) - status_obj = manifest_version.BuilderStatus(status, self.message) - return {self._bot_id: status_obj} - else: - # Slaves only need to look at their own status. - # TODO: add a method in cidb to allow querying build status using - # the build id directly (crbug.com/412845). - master_build_id = self._run.attrs.metadata.GetValue('master_build_id') - return self._run.attrs.manifest_manager.GetBuildersStatus( - master_build_id, [self._bot_id]) + # This is a slave build, so return the status for this + # build. The status is available locally. + status = manifest_version.BuilderStatus.GetCompletedStatus(self.success) + status_obj = manifest_version.BuilderStatus(status, self.message) + return {self._bot_id: status_obj} else: # This is a master build, so wait for all the slaves to finish # and return their statuses. @@ -181,7 +172,6 @@ class MasterSlaveSyncCompletionStage(ManifestVersionedSyncCompletionStage): else: timeout = self.SLAVE_STATUS_TIMEOUT_SECONDS - master_build_id = self._run.attrs.metadata.GetValue('build_id') builders = self._GetSlaveConfigs() builder_names = [b['name'] for b in builders] @@ -189,8 +179,10 @@ class MasterSlaveSyncCompletionStage(ManifestVersionedSyncCompletionStage): if sync_stages.MasterSlaveLKGMSyncStage.sub_manager: manager = sync_stages.MasterSlaveLKGMSyncStage.sub_manager - return manager.GetBuildersStatus(master_build_id, builder_names, - timeout=timeout) + return manager.GetBuildersStatus( + self._run.attrs.metadata.GetValue('build_id'), + builder_names, + timeout=timeout) def _HandleStageException(self, exc_info): """Decide whether an exception should be treated as fatal.""" |