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 218400 0d8c681e9cb0959ba5f2dcf438d059b64d60231e
parent 218399 13d8be2c624f43365869345ccea6ed55b232b02f
child 218401 7bb1f80c57386f392074575b836c27d23b29d79e
push id4
push userryanvm@gmail.com
push dateMon, 13 Oct 2014 16:45:01 +0000
treeherdermozilla-b2g34_v2_1@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher, NPOTB
bugs917817
milestone25.0
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()
@@ -440,17 +440,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
@@ -82,32 +82,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()
 
@@ -143,17 +143,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):
   """
@@ -596,17 +596,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
@@ -135,17 +135,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
@@ -419,17 +419,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:
-            print "ERROR: missing end of test marker (process crashed?)"
+            print "Automation Error: Missing end of test marker (process crashed?)"
             result = 1
         return result
 
     def printLog(self):
         passed = 0
         failed = 0
         todo = 0
         incr = 1