Bug 1118852 - Print out information about leaked DOM windows and doc shells. r=chmanchester
authorAndrew McCreight <continuation@gmail.com>
Mon, 12 Jan 2015 16:09:06 -0800
changeset 223452 0881f9a22f4adaf2ad744561cc1d465ec2a0a9a7
parent 223451 7de37d6b2f4c345bb212ad57b237d398101086b7
child 223453 c602d8753a4e90d3bb31046106319e388c710a0f
push id28095
push usercbook@mozilla.com
push dateTue, 13 Jan 2015 13:24:48 +0000
treeherdermozilla-central@a5700bec72e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1118852
milestone38.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 1118852 - Print out information about leaked DOM windows and doc shells. r=chmanchester
build/automationutils.py
--- a/build/automationutils.py
+++ b/build/automationutils.py
@@ -468,30 +468,35 @@ class ShutdownLeaks(object):
   def process(self):
     if not self.seenShutdown:
       self.logger.warning("TEST-UNEXPECTED-FAIL | ShutdownLeaks | process() called before end of test suite")
 
     for test in self._parseLeakingTests():
       for url, count in self._zipLeakedWindows(test["leakedWindows"]):
         self.logger.warning("TEST-UNEXPECTED-FAIL | %s | leaked %d window(s) until shutdown [url = %s]" % (test["fileName"], count, url))
 
+      if test["leakedWindowsString"]:
+        self.logger.info("TEST-INFO | %s | windows(s) leaked: %s" % (test["fileName"], test["leakedWindowsString"]))
+
       if test["leakedDocShells"]:
         self.logger.warning("TEST-UNEXPECTED-FAIL | %s | leaked %d docShell(s) until shutdown" % (test["fileName"], len(test["leakedDocShells"])))
+        self.logger.info("TEST-INFO | %s | docShell(s) leaked: %s" % (test["fileName"],
+                                                                      ', '.join(["[pid = %s] [id = %s]" % x for x in test["leakedDocShells"]])))
 
   def _logWindow(self, line):
     created = line[:2] == "++"
     pid = self._parseValue(line, "pid")
     serial = self._parseValue(line, "serial")
 
     # log line has invalid format
     if not pid or not serial:
       self.logger.warning("TEST-UNEXPECTED-FAIL | ShutdownLeaks | failed to parse line <%s>" % line)
       return
 
-    key = pid + "." + serial
+    key = (pid, serial)
 
     if self.currentTest:
       windows = self.currentTest["windows"]
       if created:
         windows.add(key)
       else:
         windows.discard(key)
     elif self.seenShutdown and not created:
@@ -502,17 +507,17 @@ class ShutdownLeaks(object):
     pid = self._parseValue(line, "pid")
     id = self._parseValue(line, "id")
 
     # log line has invalid format
     if not pid or not id:
       self.logger.warning("TEST-UNEXPECTED-FAIL | ShutdownLeaks | failed to parse line <%s>" % line)
       return
 
-    key = pid + "." + id
+    key = (pid, id)
 
     if self.currentTest:
       docShells = self.currentTest["docShells"]
       if created:
         docShells.add(key)
       else:
         docShells.discard(key)
     elif self.seenShutdown and not created:
@@ -523,17 +528,19 @@ class ShutdownLeaks(object):
     if match:
       return match.group(1)
     return None
 
   def _parseLeakingTests(self):
     leakingTests = []
 
     for test in self.tests:
-      test["leakedWindows"] = [self.leakedWindows[id] for id in test["windows"] if id in self.leakedWindows]
+      leakedWindows = [id for id in test["windows"] if id in self.leakedWindows]
+      test["leakedWindows"] = [self.leakedWindows[id] for id in leakedWindows]
+      test["leakedWindowsString"] = ', '.join(["[pid = %s] [serial = %s]" % x for x in leakedWindows])
       test["leakedDocShells"] = [id for id in test["docShells"] if id in self.leakedDocShells]
       test["leakCount"] = len(test["leakedWindows"]) + len(test["leakedDocShells"])
 
       if test["leakCount"]:
         leakingTests.append(test)
 
     return sorted(leakingTests, key=itemgetter("leakCount"), reverse=True)