Bug 812135 - checkForZombies should return the result; r=jmaher
authorEd Morley <emorley@mozilla.com>
Tue, 20 Nov 2012 15:24:28 +0000
changeset 113782 11b11d72993ca1bdde5634eecfade910fc082615
parent 113781 5cdd053b27881e2ec35b2ba554511a20e24df31d
child 113783 67278b9bea6f211edd911bba246868a2091c8eda
push id23890
push userryanvm@gmail.com
push dateWed, 21 Nov 2012 02:43:32 +0000
treeherdermozilla-central@4f19e7fd8bea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs812135
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 812135 - checkForZombies should return the result; r=jmaher
build/automation.py.in
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -973,34 +973,39 @@ user_pref("camino.use_system_proxy_setti
       else:
         args.append((testURL))
     args.extend(extraArgs)
     return cmd, args
 
   def checkForZombies(self, processLog):
     """ Look for hung processes """
     if not os.path.exists(processLog):
-      self.log.info('INFO | automation.py | PID log not found: %s', processLog)
-    else:
-      self.log.info('INFO | automation.py | Reading PID log: %s', processLog)
-      processList = []
-      pidRE = re.compile(r'launched child process (\d+)$')
-      processLogFD = open(processLog)
-      for line in processLogFD:
-        self.log.info(line.rstrip())
-        m = pidRE.search(line)
-        if m:
-          processList.append(int(m.group(1)))
-      processLogFD.close()
+      self.log.info('Automation Error: PID log not found: %s', processLog)
+      # Whilst no hung process was found, the run should still display as a failure
+      return True
 
-      for processPID in processList:
-        self.log.info("INFO | automation.py | Checking for orphan process with PID: %d", processPID)
-        if self.isPidAlive(processPID):
-          self.log.info("TEST-UNEXPECTED-FAIL | automation.py | child process %d still alive after shutdown", processPID)
-          self.killPid(processPID)
+    foundZombie = False
+    self.log.info('INFO | automation.py | Reading PID log: %s', processLog)
+    processList = []
+    pidRE = re.compile(r'launched child process (\d+)$')
+    processLogFD = open(processLog)
+    for line in processLogFD:
+      self.log.info(line.rstrip())
+      m = pidRE.search(line)
+      if m:
+        processList.append(int(m.group(1)))
+    processLogFD.close()
+
+    for processPID in processList:
+      self.log.info("INFO | automation.py | Checking for orphan process with PID: %d", processPID)
+      if self.isPidAlive(processPID):
+        foundZombie = True
+        self.log.info("TEST-UNEXPECTED-FAIL | automation.py | child process %d still alive after shutdown", processPID)
+        self.killPid(processPID)
+    return foundZombie
 
   def checkForCrashes(self, profileDir, symbolsPath):
     return automationutils.checkForCrashes(os.path.join(profileDir, "minidumps"), symbolsPath, self.lastTestSeen)
 
   def runApp(self, testURL, env, app, profileDir, extraArgs,
              runSSLTunnel = False, utilityPath = None,
              xrePath = None, certPath = None,
              debuggerInfo = None, symbolsPath = None,