aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2016-11-02 15:22:28 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-11-07 16:15:21 -0800
commit097419758febae084477a01fd92d678218b578e5 (patch)
treef6af94328d86c123cd53ef3c974411b0f4bead06
parent4b133961b76c2cb8bc58f0ea2cded9e3438ffb6f (diff)
downloadtoolchain-utils-097419758febae084477a01fd92d678218b578e5.tar.gz
[toolchain-utils] Update rotating testers to launch asynchronously.
Currently the rotating testers launch one trybot job, then wait for it to finish (to get the trybot image name) before launching the second job. Now that all the testing happens directly in the buildbot HWTest stages, this waiting in not needed. This CL removes the synchronous waiting from the rotating testers. (Allows the two jobs to run in parallel). BUG=None TEST=None Change-Id: I6c96c684dc69b205b847b584b4bbc9e10cf5313f Reviewed-on: https://chrome-internal-review.googlesource.com/302137 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Yunlian Jiang <yunlian@google.com>
-rwxr-xr-xbuildbot_test_llvm.py46
-rw-r--r--cros_utils/buildbot_utils.py8
2 files changed, 10 insertions, 44 deletions
diff --git a/buildbot_test_llvm.py b/buildbot_test_llvm.py
index dfb04994..3923bb09 100755
--- a/buildbot_test_llvm.py
+++ b/buildbot_test_llvm.py
@@ -87,54 +87,16 @@ class ToolchainVerifier(object):
date_str = datetime.date.today()
description = 'master_%s_%s_%s' % (self._patches_string, self._build,
date_str)
- trybot_image = buildbot_utils.GetTrybotImage(
+ _ = buildbot_utils.GetTrybotImage(
self._chromeos_root,
self._build,
self._patches,
description,
- other_flags=flags)
- if len(trybot_image) == 0:
- self._l.LogError('Unable to find trybot_image for %s!' % description)
- return 1
-
- if os.getlogin() == ROLE_ACCOUNT:
- self._FinishSetup()
+ other_flags=flags,
+ async=True)
return 0
-
-def SendEmail(start_board, compiler):
- """Send out the test results for all the boards."""
-
- # This is no longer the correct way to get results. Until
- # this is fixed, don't send any email at all.
- return 0
-
- results = ''
- for i in range(len(TEST_BOARD)):
- board = TEST_BOARD[(start_board + i) % len(TEST_BOARD)]
- f = os.path.join(VALIDATION_RESULT_DIR, compiler, board)
- if not os.path.exists(f):
- continue
- results += board
- results += '\n'
- file_name = os.path.join(VALIDATION_RESULT_DIR, f)
- with open(file_name, 'r') as readin:
- read_data = readin.read()
- results += read_data
-
- output = os.path.join(VALIDATION_RESULT_DIR, compiler, 'result')
- with open(output, 'w') as out:
- out.write(results)
-
- ce = command_executer.GetCommandExecuter()
- if os.path.exists(os.path.expanduser(MAIL_PROGRAM)):
- email_title = '%s validation test results' % compiler
- command = ('cat %s | %s -s "%s" -team' %
- (output, MAIL_PROGRAM, email_title))
- ce.RunCommand(command)
-
-
def Main(argv):
"""The main function."""
@@ -197,8 +159,6 @@ def Main(argv):
with open(logfile, 'w') as f:
f.write('Verifier got an exception, please check the log.\n')
- SendEmail(start_board, options.compiler)
-
if __name__ == '__main__':
retval = Main(sys.argv)
diff --git a/cros_utils/buildbot_utils.py b/cros_utils/buildbot_utils.py
index a0caeefc..3b0b916b 100644
--- a/cros_utils/buildbot_utils.py
+++ b/cros_utils/buildbot_utils.py
@@ -183,7 +183,8 @@ def GetTrybotImage(chromeos_root,
patch_list,
build_tag,
other_flags=[],
- build_toolchain=False):
+ build_toolchain=False,
+ async=False):
"""Launch buildbot and get resulting trybot artifact name.
This function launches a buildbot with the appropriate flags to
@@ -234,6 +235,11 @@ def GetTrybotImage(chromeos_root,
if 'Tryjob submitted!' not in out:
logger.GetLogger().LogFatal('Error occurred while launching trybot job: '
'%s' % command)
+
+ if async:
+ # Do not wait for trybot job to finish; return immediately
+ return 0
+
os.chdir(base_dir)
build_id = 0