[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>
diff --git a/buildbot_test_llvm.py b/buildbot_test_llvm.py
index dfb0499..3923bb0 100755
--- a/buildbot_test_llvm.py
+++ b/buildbot_test_llvm.py
@@ -87,54 +87,16 @@
     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 @@
       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 a0caeef..3b0b916 100644
--- a/cros_utils/buildbot_utils.py
+++ b/cros_utils/buildbot_utils.py
@@ -183,7 +183,8 @@
                    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 @@
   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