Bug 740242 - runtests.py | Received unexpected exception while running application ''NoneType' object has no attribute 'group'', r=ted a=lsblakk
authorTim Taubert <tim.taubert@gmx.de>
Fri, 04 May 2012 05:34:00 -0700
changeset 92612 9e63a64ef822fe0155cce7a74e8953325113d2b2
parent 92611 6758d40424591917ad1b7bbb4a0da0d29e37244e
child 92613 737826ff7a0c8a34fd1371e9b526f5ec2c8a1bef
push id136
push userlsblakk@mozilla.com
push dateFri, 01 Jun 2012 02:39:32 +0000
treeherdermozilla-release@7ebf7352c959 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, lsblakk
bugs740242
milestone13.0
Bug 740242 - runtests.py | Received unexpected exception while running application ''NoneType' object has no attribute 'group'', r=ted a=lsblakk
build/automationutils.py
--- a/build/automationutils.py
+++ b/build/automationutils.py
@@ -502,40 +502,50 @@ class ShutdownLeakLogger(object):
 
       if test["leakedDocShells"]:
         self.logger.info("  %d docShell(s)", len(test["leakedDocShells"]))
 
   def _logWindow(self, line):
     created = line[:2] == "++"
     id = self._parseValue(line, "serial")
 
+    # log line has invalid format
+    if not id:
+      return
+
     if self.currentTest:
       windows = self.currentTest["windows"]
       if created:
         windows.add(id)
       else:
         windows.discard(id)
     elif self.seenShutdown and not created:
       self.leakedWindows[id] = self._parseValue(line, "url")
 
   def _logDocShell(self, line):
     created = line[:2] == "++"
     id = self._parseValue(line, "id")
 
+    # log line has invalid format
+    if not id:
+      return
+
     if self.currentTest:
       docShells = self.currentTest["docShells"]
       if created:
         docShells.add(id)
       else:
         docShells.discard(id)
     elif self.seenShutdown and not created:
       self.leakedDocShells.add(id)
 
   def _parseValue(self, line, name):
-    return re.search("\[%s = (.+?)\]" % name, line).group(1)
+    match = re.search("\[%s = (.+?)\]" % name, line)
+    if match:
+      return match.group(1)
 
   def _parseLeakingTests(self):
     leakingTests = []
 
     for test in self.tests:
       test["leakedWindows"] = [self.leakedWindows[id] for id in test["windows"] if id in self.leakedWindows]
       test["leakedDocShells"] = [id for id in test["docShells"] if id in self.leakedDocShells]
       test["leakCount"] = len(test["leakedWindows"]) + len(test["leakedDocShells"])