Bug 1313265 - Log messages containing 'TEST-UNEXPECTED-FAIL' at the error level in mochitest, r=jgraham
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Thu, 27 Oct 2016 15:03:38 -0400
changeset 319957 28afa97fa70dba7742a9ef15bbd9947a43711972
parent 319956 5612fd602e57def5eb9ccaebfa6dbac16055dba0
child 319958 b96b2b49be987aed5d1ffa2dcc1a549b658b458a
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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)