aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYunlian Jiang <yunlian@google.com>2016-01-06 12:56:24 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-01-07 00:36:27 +0000
commit56f13765cdc7bb3f380ccbbc02b9af95af2e0592 (patch)
tree696fad4808115e7b5dde1d99ce5fee554b964c9b
parent5dd0459f8a7207ddcee26baa4917c2a6e20fba67 (diff)
downloadtoolchain-utils-56f13765cdc7bb3f380ccbbc02b9af95af2e0592.tar.gz
toolchain-utils: check vanilla image before calling crosperf.
In some cases, the vanilla image builds finishes later than the image from trybot, this could cause the nightly test job fail. This CL makes sure the vanilla image is ready before calling crosperf. BUG=None TEST=None Change-Id: Id2f28717c5a8c6c6db0d6c2e240c687199ea6a7c Reviewed-on: https://chrome-internal-review.googlesource.com/243618 Commit-Ready: Yunlian Jiang <yunlian@google.com> Tested-by: Yunlian Jiang <yunlian@google.com> Reviewed-by: Yunlian Jiang <yunlian@google.com>
-rwxr-xr-xbuildbot_test_toolchains.py3
-rw-r--r--utils/buildbot_utils.py23
2 files changed, 26 insertions, 0 deletions
diff --git a/buildbot_test_toolchains.py b/buildbot_test_toolchains.py
index b984fca7..ea6099b6 100755
--- a/buildbot_test_toolchains.py
+++ b/buildbot_test_toolchains.py
@@ -288,6 +288,9 @@ class ToolchainComparator(object):
vanilla_image = self._ParseVanillaImage(trybot_image)
nonafdo_image = self._ParseNonAFDOImage(trybot_image)
+ # The trybot image is ready here, in some cases, the vanilla image
+ # is not ready, so we need to make sure vanilla image is available.
+ buildbot_utils.WaitForImage(self._chromeos_root, vanilla_image)
print('trybot_image: %s' % trybot_image)
print('vanilla_image: %s' % vanilla_image)
print('nonafdo_image: %s' % nonafdo_image)
diff --git a/utils/buildbot_utils.py b/utils/buildbot_utils.py
index 2d7960a5..0116fc61 100644
--- a/utils/buildbot_utils.py
+++ b/utils/buildbot_utils.py
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+"""Module for building with cbuildbot."""
+
from __future__ import print_function
import os
@@ -294,3 +296,24 @@ def GetTrybotImage(chromeos_root,
logger.GetLogger().LogOutput("trybot_image is '%s'" % trybot_image)
logger.GetLogger().LogOutput('build_status is %d' % build_status)
return trybot_image
+
+def WaitForImage(chromeos_root, build):
+ """Wait for a image to be ready."""
+
+ ready = False
+ elapsed_time = 0
+ ce = command_executer.GetCommandExecuter()
+ command = ('gsutil ls gs://chromeos-image-archive/%s'
+ '/chromiumos_test_image.tar.xz' % (build))
+ while not ready and elapsed_time < TIME_OUT:
+ ret = ce.ChrootRunCommand(chromeos_root,
+ command,
+ print_to_console=False)
+ if not ret:
+ return ret
+ logger.GetLogger().LogOutput("Image %s not ready, waiting for 10 minutes"
+ % build)
+ time.sleep(SLEEP_TIME)
+ elapsed_time += SLEEP_TIME
+
+ return ret