diff options
author | cmtice <cmtice@google.com> | 2015-02-12 15:18:43 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-02-14 04:27:26 +0000 |
commit | ce5ffa4249faa2f50f08c4168b61bb922381450f (patch) | |
tree | d5b8b3a413b3eab4bb4acdbe253862758427a223 /utils | |
parent | 86cd5ab71d86a46853af6c25e5c98f8f15da6d5d (diff) | |
download | toolchain-utils-ce5ffa4249faa2f50f08c4168b61bb922381450f.tar.gz |
Add date to job descriptions; wait for pending builds.
Previously if a trybot job got put into a pending queue
rather than starting immediately, we didn't notice and
would end up using the previous day's trybot image. This
CL fixes that.
BUG=None
TEST=Ran successfully from role account.
Change-Id: I3dd2cf1edd639e562fa78769c86c99e4c51f3a0b
Reviewed-on: https://chrome-internal-review.googlesource.com/198610
Reviewed-by: Yunlian Jiang <yunlian@google.com>
Reviewed-by: Caroline Tice <cmtice@google.com>
Commit-Queue: Caroline Tice <cmtice@google.com>
Tested-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/buildbot_utils.py | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/utils/buildbot_utils.py b/utils/buildbot_utils.py index 15b4a8e1..7afa2a32 100644 --- a/utils/buildbot_utils.py +++ b/utils/buildbot_utils.py @@ -184,6 +184,7 @@ def GetTrybotImage(chromeos_root, buildbot_name, patch_list, build_tag): # Wait for buildbot to finish running (check every 10 minutes) done = False running_time = 0 + pending_time = 0 while not done: done = True build_info = GetBuildInfo(base_dir) @@ -193,22 +194,33 @@ def GetTrybotImage(chromeos_root, buildbot_name, patch_list, build_tag): data_dict = FindBuildRecordFromLog(description, build_info) if not data_dict: - logger.GetLogger().LogFatal("Unable to find build record for trybot %s" - % description) + # Trybot job may be pending. + if pending_time > TIME_OUT: + logger.GetLogger().LogFatal("Unable to find build record for trybot %s" + % description) + else: + logger.GetLogger().LogOutput("Unable to find build record; job may be pending.") + logger.GetLogger().LogOutput("Current pending time: {0} minutes.".format( + pending_time / 60)) + logger.GetLogger().LogOutput("Sleeping {0} seconds.".format(SLEEP_TIME)) + time.sleep(SLEEP_TIME) + pending_time += SLEEP_TIME + done = False - if "True" in data_dict["completed"]: - build_id = data_dict["number"] - build_status = int(data_dict["result"]) else: - done = False - - if not done: - logger.GetLogger().LogOutput("{0} minutes passed.".format( - running_time / 60)) - logger.GetLogger().LogOutput("Sleeping {0} seconds.".format(SLEEP_TIME)) - time.sleep(SLEEP_TIME) - running_time += SLEEP_TIME - if running_time > TIME_OUT: + if "True" in data_dict["completed"]: + build_id = data_dict["number"] + build_status = int(data_dict["result"]) + else: + done = False + + if not done: + logger.GetLogger().LogOutput("{0} minutes passed.".format( + running_time / 60)) + logger.GetLogger().LogOutput("Sleeping {0} seconds.".format(SLEEP_TIME)) + time.sleep(SLEEP_TIME) + running_time += SLEEP_TIME + if running_time > TIME_OUT: done = True trybot_image = FindArchiveImage(chromeos_root, build, build_id) |