Changeset 91488 in webkit


Ignore:
Timestamp:
Jul 21, 2011, 12:15:35 PM (14 years ago)
Author:
eric@webkit.org
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:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r91487 r91488  
     12011-07-21  Eric Seidel  <eric@webkit.org>
     2
     3        Unreviewed.  Just fixing (and unittesting) a previous typo.
     4
     5        Fix typo in print_leaks_summary regexp which was causing
     6        leaks summarizing to fail on the --leaks bot.
     7
     8        * Scripts/webkitpy/layout_tests/port/mac.py:
     9        * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
     10
    1112011-07-21  Adam Barth  <abarth@webkit.org>
    212
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py

    r91323 r91488  
    116116            return
    117117
     118        # total: 5,888 bytes (0 bytes excluded).
    118119        unique_leak_count = len(re.findall(r'^(\d*)\scalls', parse_malloc_history_output))
    119         total_bytes = int(re.search(r'^total\:\s(.*)\s\(', parse_malloc_history_output).group(1))
    120         return (total_bytes, unique_leak_count)
     120        total_bytes_string = re.search(r'^total\:\s(.+)\s\(', parse_malloc_history_output, re.MULTILINE).group(1)
     121        return (total_bytes_string, unique_leak_count)
    121122
    122123    def check_for_leaks(self, process_name, process_pid):
     
    131132            return
    132133
     134        # FIXME: We should consider moving leaks parsing to the end when summarizing is done.
    133135        count, excluded, bytes = self._parse_leaks_output(leaks_output, process_pid)
    134136        adjusted_count = count - excluded
     
    254256        # We're in the manager process, so the leak detector will not have a valid list of leak files.
    255257        # FIXME: This is a hack, but we don't have a better way to get this information from the workers yet.
     258        # FIXME: This will include too many leaks in subsequent runs until the results directory is cleared!
    256259        leaks_files = self._leak_detector.leaks_files_in_directory(self.results_directory())
    257260        if not leaks_files:
    258261            return
    259         total_bytes, unique_leaks = self._leak_detector.parse_leak_files(leaks_files)
    260         _log.info("%s total leaks found for a total of %s!" % (self._total_leaks, total_bytes))
     262        total_bytes_string, unique_leaks = self._leak_detector.parse_leak_files(leaks_files)
     263        # old-run-webkit-tests used to print the "total leaks" count, but that would
     264        # require re-parsing each of the leaks files (which we could do at some later point if that would be useful.)
     265        # Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg greps for "leaks found".
     266        # master.cfg will need an update if these strings change.
     267        _log.info("leaks found for a total of %s!" % total_bytes_string)
    261268        _log.info("%s unique leaks found!" % unique_leaks)
    262269
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py

    r91245 r91488  
    100100        def mock_run_script(name, args, include_configuration_arguments=False):
    101101            print "MOCK _run_script: %s %s" % (name, args)
    102             return "total: 12345 ("
     102            return """1 calls for 16 bytes: -[NSURLRequest mutableCopyWithZone:] | +[NSObject(NSObject) allocWithZone:] | _internal_class_createInstanceFromZone | calloc | malloc_zone_calloc
     103
     104total: 5,888 bytes (0 bytes excluded)."""
    103105        detector._port._run_script = mock_run_script
    104106
     
    106108        expected_stdout = "MOCK _run_script: parse-malloc-history ['--merge-depth', 5, '/mock-results/leaks-DumpRenderTree-1234.txt', '/mock-results/leaks-DumpRenderTree-1235.txt']\n"
    107109        results_tuple = OutputCapture().assert_outputs(self, detector.parse_leak_files, [leak_files], expected_stdout=expected_stdout)
    108         self.assertEquals(results_tuple, (12345, 0))
     110        self.assertEquals(results_tuple, ("5,888 bytes", 1))
    109111
    110112
Note: See TracChangeset for help on using the changeset viewer.