Bug 1313265 - Log messages containing 'TEST-UNEXPECTED-FAIL' at the error level in mochitest, r?jgraham draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Thu, 27 Oct 2016 15:03:38 -0400
changeset 430433 6788a1ac65f71f9d9ea5553b496539fe7a1fa83e
parent 430359 9888f1a23001fde6435e1a9ed7e6d3af8dd988d8
child 430434 9cce45dbb7d5ccb78619ccefeb41a8f9417ce171
child 430437 b4e073da7ad16ffc9e657160105b1d5fdd669bda
push id33829
push userahalberstadt@mozilla.com
push dateThu, 27 Oct 2016 19:40:25 +0000
reviewersjgraham
bugs1313265, 1261194
milestone52.0a1
Bug 1313265 - Log messages containing 'TEST-UNEXPECTED-FAIL' at the error level in mochitest, r?jgraham We were previously logging these at the info level as a really hacky way to make sure that the mozharness output parser was able to detect them. Since bug 1261194 switched mochitests to use the StructuredOutputParser, we now need to log them at the error level or they won't get picked up anymore. MozReview-Commit-ID: 99n9YizlEDH
testing/mochitest/runtests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -451,17 +451,17 @@ class MochitestServer(object):
         aliveFile = os.path.join(self._profileDir, "server_alive.txt")
         i = 0
         while i < timeout:
             if os.path.exists(aliveFile):
                 break
             time.sleep(.05)
             i += .05
         else:
-            self._log.info(
+            self._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()
@@ -1231,17 +1231,17 @@ toolbar#nav-bar {
 }
 """
         with open(os.path.join(options.profilePath, "userChrome.css"), "a") as chromeFile:
             chromeFile.write(chrome)
 
         manifest = self.writeChromeManifest(options)
 
         if not os.path.isdir(self.mochijar):
-            self.log.info(
+            self.log.error(
                 "TEST-UNEXPECTED-FAIL | invalid setup: missing mochikit extension")
             return None
 
         return manifest
 
     def getExtensionsToInstall(self, options):
         "Return a list of extensions to install in the profile"
         extensions = []
@@ -1710,17 +1710,17 @@ toolbar#nav-bar {
 
         manifest = self.addChromeToProfile(options)
         self.copyExtraFilesToProfile(options)
 
         # create certificate database for the profile
         # TODO: this should really be upstreamed somewhere, maybe mozprofile
         certificateStatus = self.fillCertificateDB(options)
         if certificateStatus:
-            self.log.info(
+            self.log.error(
                 "TEST-UNEXPECTED-FAIL | runtests.py | Certificate integration failed")
             return None
 
         return manifest
 
     def getGMPPluginPath(self, options):
         if options.gmp_path:
             return options.gmp_path
@@ -1841,18 +1841,18 @@ toolbar#nav-bar {
         # kill zombies
         foundZombie = False
         for processPID in processList:
             self.log.info(
                 "zombiecheck | Checking for orphan process with PID: %d" %
                 processPID)
             if isPidAlive(processPID):
                 foundZombie = True
-                self.log.info("TEST-UNEXPECTED-FAIL | zombiecheck | child process "
-                              "%d still alive after shutdown" % processPID)
+                self.log.error("TEST-UNEXPECTED-FAIL | zombiecheck | child process "
+                               "%d still alive after shutdown" % processPID)
                 self.killAndGetStack(
                     processPID,
                     utilityPath,
                     debuggerInfo,
                     dump_screen=not debuggerInfo)
 
         return foundZombie
 
@@ -2034,17 +2034,17 @@ toolbar#nav-bar {
             runner.process_handler = None
 
             # finalize output handler
             outputHandler.finish()
 
             # record post-test information
             if status:
                 self.message_logger.dump_buffered()
-                self.log.info(
+                self.log.error(
                     "TEST-UNEXPECTED-FAIL | %s | application terminated with exit code %s" %
                     (self.lastTestSeen, status))
             else:
                 self.lastTestSeen = 'Main app process exited normally'
 
             self.log.info(
                 "runtests.py | Application ran for: %s" % str(
                     datetime.now() - startTime))
@@ -2142,19 +2142,19 @@ toolbar#nav-bar {
         status = 0
         bisection_log = 0
         while not finished:
             if options.bisectChunk:
                 testsToRun = bisect.pre_test(options, testsToRun, status)
                 # To inform that we are in the process of bisection, and to
                 # look for bleedthrough
                 if options.bisectChunk != "default" and not bisection_log:
-                    self.log.info("TEST-UNEXPECTED-FAIL | Bisection | Please ignore repeats "
-                                  "and look for 'Bleedthrough' (if any) at the end of "
-                                  "the failure list")
+                    self.log.error("TEST-UNEXPECTED-FAIL | Bisection | Please ignore repeats "
+                                   "and look for 'Bleedthrough' (if any) at the end of "
+                                   "the failure list")
                     bisection_log = 1
 
             result = self.doTests(options, testsToRun)
             if options.bisectChunk:
                 status = bisect.post_test(
                     options,
                     self.expectedError,
                     self.result)