Bug 917817 - Make several more python test harness failure modes TBPL parsable. r=jmaher, a=NPOTB
authorEd Morley <emorley@mozilla.com>
Thu, 19 Sep 2013 13:20:17 +0100
changeset 160373 bae0da42633b2698ab13bbc749187482e0910d73
parent 160372 0ff4dcd55258297515f5e447c426e00a9a3c921b
child 160374 9d3e90597a773ce2af08de37c1d807b58c4af35b
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher, NPOTB
bugs917817
milestone26.0a2
Bug 917817 - Make several more python test harness failure modes TBPL parsable. r=jmaher, a=NPOTB
layout/tools/reftest/remotereftest.py
testing/mochitest/runtests.py
testing/mochitest/runtestsb2g.py
testing/mochitest/runtestsremote.py
--- a/layout/tools/reftest/remotereftest.py
+++ b/layout/tools/reftest/remotereftest.py
@@ -208,17 +208,17 @@ class ReftestServer:
         if self._automation.elf_arm(xpcshell):
             raise Exception('xpcshell at %s is an ARM binary; please use '
                             'the --utility-path argument to specify the path '
                             'to a desktop version.' % xpcshell)
 
         self._process = self._automation.Process([xpcshell] + args, env = env)
         pid = self._process.pid
         if pid < 0:
-            print "Error starting server."
+            print "TEST-UNEXPECTED-FAIL | remotereftests.py | Error starting server."
             return 2
         self._automation.log.info("INFO | remotereftests.py | Server pid: %d", pid)
 
         if (self.pidFile != ""):
             f = open(self.pidFile + ".xpcshell.pid", 'w')
             f.write("%s" % pid)
             f.close()
 
@@ -228,17 +228,17 @@ class ReftestServer:
         aliveFile = os.path.join(self._profileDir, "server_alive.txt")
         i = 0
         while i < timeout:
             if os.path.exists(aliveFile):
                 break
             time.sleep(1)
             i += 1
         else:
-            print "Timed out while waiting for server startup."
+            print "TEST-UNEXPECTED-FAIL | remotereftests.py | Timed out while waiting for server startup."
             self.stop()
             return 1
 
     def stop(self):
         if hasattr(self, '_process'):
             try:
                 c = urllib2.urlopen(self.shutdownURL)
                 c.read()
@@ -433,17 +433,17 @@ def main(args):
         if (options.dm_trans == "adb"):
             if (options.deviceIP):
                 dm = droid.DroidADB(options.deviceIP, options.devicePort, deviceRoot=options.remoteTestRoot)
             else:
                 dm = droid.DroidADB(None, None, deviceRoot=options.remoteTestRoot)
         else:
             dm = droid.DroidSUT(options.deviceIP, options.devicePort, deviceRoot=options.remoteTestRoot)
     except devicemanager.DMError:
-        print "Error: exception while initializing devicemanager.  Most likely the device is not in a testable state."
+        print "Automation Error: exception while initializing devicemanager.  Most likely the device is not in a testable state."
         return 1
 
     automation.setDeviceManager(dm)
 
     if (options.remoteProductName != None):
         automation.setProduct(options.remoteProductName)
 
     # Set up the defaults and ensure options are set
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -81,32 +81,32 @@ class MochitestServer:
                     "testPrefix" : self.testPrefix, "displayResults" : str(not self._closeWhenDone).lower() },
             "-f", "./" + "server.js"]
 
     xpcshell = os.path.join(self._utilityPath,
                             "xpcshell" + mozinfo.info['bin_suffix'])
     self._process = self._automation.Process([xpcshell] + args, env = env)
     pid = self._process.pid
     if pid < 0:
-      log.error("Error starting server.")
+      log.error("TEST-UNEXPECTED-FAIL | runtests.py | Error starting server.")
       sys.exit(2)
     log.info("runtests.py | Server pid: %d", pid)
 
   def ensureReady(self, timeout):
     assert timeout >= 0
 
     aliveFile = os.path.join(self._profileDir, "server_alive.txt")
     i = 0
     while i < timeout:
       if os.path.exists(aliveFile):
         break
       time.sleep(1)
       i += 1
     else:
-      log.error("Timed out while waiting for server startup.")
+      log.error("TEST-UNEXPECTED-FAIL | runtests.py | Timed out while waiting for server startup.")
       self.stop()
       sys.exit(1)
 
   def stop(self):
     try:
       with urllib2.urlopen(self.shutdownURL) as c:
         c.read()
 
@@ -142,17 +142,17 @@ class WebSocketServer(object):
         cmd += ['--interactive']
     cmd += ['-p', str(self.port), '-w', self._scriptdir, '-l',      \
            os.path.join(self._scriptdir, "websock.log"),            \
            '--log-level=debug', '--allow-handlers-outside-root-dir']
 
     self._process = self._automation.Process(cmd)
     pid = self._process.pid
     if pid < 0:
-      log.error("Error starting websocket server.")
+      log.error("TEST-UNEXPECTED-FAIL | runtests.py | Error starting websocket server.")
       sys.exit(2)
     log.info("runtests.py | Websocket server pid: %d", pid)
 
   def stop(self):
     self._process.kill()
 
 class MochitestUtilsMixin(object):
   """
@@ -603,17 +603,17 @@ class Mochitest(MochitestUtilsMixin):
                                   symbolsPath=options.symbolsPath,
                                   timeout=timeout,
                                   onLaunch=onLaunch)
     except KeyboardInterrupt:
       log.info("runtests.py | Received keyboard interrupt.\n");
       status = -1
     except:
       traceback.print_exc()
-      log.error("runtests.py | Received unexpected exception while running application\n")
+      log.error("Automation Error: Received unexpected exception while running application\n")
       status = 1
 
     if options.vmwareRecording:
       self.stopVMwareRecording();
 
     self.stopWebServer(options)
     self.stopWebSocketServer(options)
     processLeakLog(self.leak_report_file, options.leakThreshold)
--- a/testing/mochitest/runtestsb2g.py
+++ b/testing/mochitest/runtestsb2g.py
@@ -137,17 +137,17 @@ class B2GMochitest(MochitestUtilsMixin):
             self.runner = B2GRunner(**runner_args)
             self.runner.start(outputTimeout=timeout)
             self.runner.wait()
         except KeyboardInterrupt:
             log.info("runtests.py | Received keyboard interrupt.\n");
             status = -1
         except:
             traceback.print_exc()
-            log.error("runtests.py | Received unexpected exception while running application\n")
+            log.error("Automation Error: Received unexpected exception while running application\n")
             status = 1
 
         self.stopWebServer(options)
         self.stopWebSocketServer(options)
 
         log.info("runtestsb2g.py | Running tests: end.")
 
         if manifest is not None:
--- a/testing/mochitest/runtestsremote.py
+++ b/testing/mochitest/runtestsremote.py
@@ -418,17 +418,17 @@ class MochiRemote(Mochitest):
             if restart.match(line):
                 start_found = True
             if refail.match(line):
                 fail_found = True
         result = 0
         if fail_found:
             result = 1
         if not end_found:
-            log.error("missing end of test marker (process crashed?)")
+            log.error("Automation Error: Missing end of test marker (process crashed?)")
             result = 1
         return result
 
     def printLog(self):
         passed = 0
         failed = 0
         todo = 0
         incr = 1