Changeset 98639 in webkit
- Timestamp:
- Oct 27, 2011, 2:29:53 PM (15 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/run-webkit-tests (modified) (2 diffs)
-
Scripts/webkitpy/layout_tests/port/leakdetector.py (modified) (4 diffs)
-
Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py (modified) (3 diffs)
-
Scripts/webkitpy/layout_tests/port/mac.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r98634 r98639 1 2011-10-27 Eric Seidel <eric@webkit.org> 2 3 REGRESSION (NRWT): build.webkit.org doesn't show the total number of leaks found during a test run on the Leaks bot 4 https://bugs.webkit.org/show_bug.cgi?id=66227 5 6 Reviewed by Adam Roben. 7 8 I believe this should fix the bug. 9 10 * Scripts/run-webkit-tests: make NRWT default for --leaks 11 * Scripts/webkitpy/layout_tests/port/leakdetector.py: 12 (LeakDetector._parse_leaks_output): removed the (unneeded) process_pid argument, and made the regexp use named groups (even though we don't ever grab them by name) 13 (LeakDetector.count_total_bytes_and_unique_leaks): renamed from parse_leak_files 14 (LeakDetector.count_total_leaks): new file (the guts of this change) which is used to re-parse the leaks output during the summarize leaks phase. 15 * Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py: 16 Changes to reflect the rename of count_total_bytes_and_unique_leaks and a new test for count_total_leaks. 17 * Scripts/webkitpy/layout_tests/port/mac.py: 18 Use count_total_leaks to spit out the total leak count like ORWT did, and remove the FIXME on the subject. 19 1 20 2011-10-27 Stephen Chenney <schenney@chromium.org> 2 21 -
trunk/Tools/Scripts/run-webkit-tests
r98544 r98639 56 56 } 57 57 58 sub usingLeaks()59 {60 # LeaksViewer gets confused by NRWT's --leaks output, see bugs:61 # https://bugs.webkit.org/show_bug.cgi?id=6622762 # https://bugs.webkit.org/show_bug.cgi?id=6622863 return grep(/--leaks/, @ARGV);64 }65 66 58 sub useNewRunWebKitTests() 67 59 { … … 76 68 # NRWT Windows support still needs work: https://bugs.webkit.org/show_bug.cgi?id=38756 77 69 78 # NRWT doesn't support qt- mac, qt-arm and qt-4.8 platforms now: https://bugs.webkit.org/show_bug.cgi?id=64071 and https://bugs.webkit.org/show_bug.cgi?id=6408670 # NRWT doesn't support qt-arm and qt-4.8 platforms now: https://bugs.webkit.org/show_bug.cgi?id=64071 and https://bugs.webkit.org/show_bug.cgi?id=64086 79 71 if (isQt()) { 80 72 return (!isARM()); 81 73 } 82 74 83 return ( (isLeopard() or isSnowLeopard() or isLion() or isGtk()) and !usingLeaks());75 return (isLeopard() or isSnowLeopard() or isLion() or isGtk()); 84 76 } 85 77 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/leakdetector.py
r94345 r98639 85 85 return leaks_args 86 86 87 def _parse_leaks_output(self, leaks_output , process_pid):88 count, bytes = re.search(r'Process %s: (\d+) leaks? for (\d+) total' % process_pid, leaks_output).groups()89 excluded_match = re.search(r'( \d+) leaks? excluded', leaks_output)87 def _parse_leaks_output(self, leaks_output): 88 _, count, bytes = re.search(r'Process (?P<pid>\d+): (?P<count>\d+) leaks? for (?P<bytes>\d+) total', leaks_output).groups() 89 excluded_match = re.search(r'(?P<excluded>\d+) leaks? excluded', leaks_output) 90 90 excluded = excluded_match.group(0) if excluded_match else 0 91 91 return int(count), int(excluded), int(bytes) … … 98 98 return "%s-%s-leaks.txt" % (process_name, process_pid) 99 99 100 def parse_leak_files(self, leak_files):100 def count_total_bytes_and_unique_leaks(self, leak_files): 101 101 merge_depth = 5 # ORWT had a --merge-leak-depth argument, but that seems out of scope for the run-webkit-tests tool. 102 102 args = [ … … 115 115 return (total_bytes_string, unique_leak_count) 116 116 117 def count_total_leaks(self, leak_file_paths): 118 total_leaks = 0 119 for leak_file_path in leak_file_paths: 120 leaks_output = self._filesystem.read_text_file(leak_file_path) 121 count, _, _ = self._parse_leaks_output(leaks_output) 122 total_leaks += count 123 return total_leaks 124 117 125 def check_for_leaks(self, process_name, process_pid): 118 126 _log.debug("Checking for leaks in %s" % process_name) … … 126 134 return 127 135 128 # FIXME: We should consider moving leaks parsing to the end when summarizing is done.129 count, excluded, bytes = self._parse_leaks_output(leaks_output , process_pid)136 # FIXME: We end up parsing this output 3 times. Once here and twice for summarizing. 137 count, excluded, bytes = self._parse_leaks_output(leaks_output) 130 138 adjusted_count = count - excluded 131 139 if not adjusted_count: -
trunk/Tools/Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py
r94345 r98639 80 80 81 81 def test_parse_leaks_output(self): 82 self.assertEquals(self._make_detector()._parse_leaks_output(self.example_leaks_output , 5122), (337301, 0, 6525216))82 self.assertEquals(self._make_detector()._parse_leaks_output(self.example_leaks_output), (337301, 0, 6525216)) 83 83 84 84 def test_leaks_files_in_directory(self): … … 92 92 self.assertEquals(len(detector.leaks_files_in_directory('/mock-results')), 3) 93 93 94 def test_ parse_leak_files(self):94 def test_count_total_bytes_and_unique_leaks(self): 95 95 detector = self._make_detector() 96 96 … … 104 104 leak_files = ['/mock-results/DumpRenderTree-1234-leaks.txt', '/mock-results/DumpRenderTree-1235-leaks.txt'] 105 105 expected_stdout = "MOCK _run_script: parse-malloc-history ['--merge-depth', 5, '/mock-results/DumpRenderTree-1234-leaks.txt', '/mock-results/DumpRenderTree-1235-leaks.txt']\n" 106 results_tuple = OutputCapture().assert_outputs(self, detector. parse_leak_files, [leak_files], expected_stdout=expected_stdout)106 results_tuple = OutputCapture().assert_outputs(self, detector.count_total_bytes_and_unique_leaks, [leak_files], expected_stdout=expected_stdout) 107 107 self.assertEquals(results_tuple, ("5,888 bytes", 1)) 108 109 def test_count_total_leaks(self): 110 detector = self._make_detector() 111 detector._filesystem = MockFileSystem({ 112 '/mock-results/DumpRenderTree-1234-leaks.txt': 'Process 1234: 12 leaks for 40 total leaked bytes.\n', 113 '/mock-results/DumpRenderTree-23423-leaks.txt': 'Process 1235: 12341 leaks for 27934 total leaked bytes.\n', 114 '/mock-results/DumpRenderTree-823-leaks.txt': 'Process 12356: 23412 leaks for 18 total leaked bytes.\n', 115 }) 116 leak_file_paths = ['/mock-results/DumpRenderTree-1234-leaks.txt', '/mock-results/DumpRenderTree-23423-leaks.txt', '/mock-results/DumpRenderTree-823-leaks.txt'] 117 self.assertEquals(detector.count_total_leaks(leak_file_paths), 35765) -
trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py
r93383 r98639 140 140 if not leaks_files: 141 141 return 142 total_bytes_string, unique_leaks = self._leak_detector.parse_leak_files(leaks_files) 143 # old-run-webkit-tests used to print the "total leaks" count, but that would 144 # require re-parsing each of the leaks files (which we could do at some later point if that would be useful.) 145 # Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg greps for "leaks found". 146 # master.cfg will need an update if these strings change. 147 _log.info("leaks found for a total of %s!" % total_bytes_string) 142 total_bytes_string, unique_leaks = self._leak_detector.count_total_bytes_and_unique_leaks(leaks_files) 143 total_leaks = self._leak_detector.count_total_leaks(leaks_files) 144 _log.info("%s total leaks found for a total of %s!" % (total_leaks, total_bytes_string)) 148 145 _log.info("%s unique leaks found!" % unique_leaks) 149 146
Note:
See TracChangeset
for help on using the changeset viewer.