Title: [91488] trunk/Tools
Revision
91488
Author
[email protected]
Date
2011-07-21 12:15:35 -0700 (Thu, 21 Jul 2011)

Log Message

Unreviewed.  Just fixing (and unittesting) a previous typo.

Fix typo in print_leaks_summary regexp which was causing
leaks summarizing to fail on the --leaks bot.

* Scripts/webkitpy/layout_tests/port/mac.py:
* Scripts/webkitpy/layout_tests/port/mac_unittest.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (91487 => 91488)


--- trunk/Tools/ChangeLog	2011-07-21 19:14:39 UTC (rev 91487)
+++ trunk/Tools/ChangeLog	2011-07-21 19:15:35 UTC (rev 91488)
@@ -1,3 +1,13 @@
+2011-07-21  Eric Seidel  <[email protected]>
+
+        Unreviewed.  Just fixing (and unittesting) a previous typo.
+
+        Fix typo in print_leaks_summary regexp which was causing
+        leaks summarizing to fail on the --leaks bot.
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+
 2011-07-21  Adam Barth  <[email protected]>
 
         garden-o-matic should be able to rebaseline many tests at once

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py (91487 => 91488)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py	2011-07-21 19:14:39 UTC (rev 91487)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py	2011-07-21 19:15:35 UTC (rev 91488)
@@ -115,9 +115,10 @@
             _log.warn("Failed to parse leaks output: %s" % e.message_with_output())
             return
 
+        # total: 5,888 bytes (0 bytes excluded).
         unique_leak_count = len(re.findall(r'^(\d*)\scalls', parse_malloc_history_output))
-        total_bytes = int(re.search(r'^total\:\s(.*)\s\(', parse_malloc_history_output).group(1))
-        return (total_bytes, unique_leak_count)
+        total_bytes_string = re.search(r'^total\:\s(.+)\s\(', parse_malloc_history_output, re.MULTILINE).group(1)
+        return (total_bytes_string, unique_leak_count)
 
     def check_for_leaks(self, process_name, process_pid):
         _log.debug("Checking for leaks in %s" % process_name)
@@ -130,6 +131,7 @@
             _log.warn("Failed to run leaks tool: %s" % e.message_with_output())
             return
 
+        # FIXME: We should consider moving leaks parsing to the end when summarizing is done.
         count, excluded, bytes = self._parse_leaks_output(leaks_output, process_pid)
         adjusted_count = count - excluded
         if not adjusted_count:
@@ -253,11 +255,16 @@
             return
         # We're in the manager process, so the leak detector will not have a valid list of leak files.
         # FIXME: This is a hack, but we don't have a better way to get this information from the workers yet.
+        # FIXME: This will include too many leaks in subsequent runs until the results directory is cleared!
         leaks_files = self._leak_detector.leaks_files_in_directory(self.results_directory())
         if not leaks_files:
             return
-        total_bytes, unique_leaks = self._leak_detector.parse_leak_files(leaks_files)
-        _log.info("%s total leaks found for a total of %s!" % (self._total_leaks, total_bytes))
+        total_bytes_string, unique_leaks = self._leak_detector.parse_leak_files(leaks_files)
+        # old-run-webkit-tests used to print the "total leaks" count, but that would
+        # require re-parsing each of the leaks files (which we could do at some later point if that would be useful.)
+        # Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg greps for "leaks found".
+        # master.cfg will need an update if these strings change.
+        _log.info("leaks found for a total of %s!" % total_bytes_string)
         _log.info("%s unique leaks found!" % unique_leaks)
 
     def _check_port_build(self):

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py (91487 => 91488)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py	2011-07-21 19:14:39 UTC (rev 91487)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py	2011-07-21 19:15:35 UTC (rev 91488)
@@ -99,13 +99,15 @@
 
         def mock_run_script(name, args, include_configuration_arguments=False):
             print "MOCK _run_script: %s %s" % (name, args)
-            return "total: 12345 ("
+            return """1 calls for 16 bytes: -[NSURLRequest mutableCopyWithZone:] | +[NSObject(NSObject) allocWithZone:] | _internal_class_createInstanceFromZone | calloc | malloc_zone_calloc
+
+total: 5,888 bytes (0 bytes excluded)."""
         detector._port._run_script = mock_run_script
 
         leak_files = ['/mock-results/leaks-DumpRenderTree-1234.txt', '/mock-results/leaks-DumpRenderTree-1235.txt']
         expected_stdout = "MOCK _run_script: parse-malloc-history ['--merge-depth', 5, '/mock-results/leaks-DumpRenderTree-1234.txt', '/mock-results/leaks-DumpRenderTree-1235.txt']\n"
         results_tuple = OutputCapture().assert_outputs(self, detector.parse_leak_files, [leak_files], expected_stdout=expected_stdout)
-        self.assertEquals(results_tuple, (12345, 0))
+        self.assertEquals(results_tuple, ("5,888 bytes", 1))
 
 
 class MacTest(port_testcase.PortTestCase):
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to