Changeset 119030 in webkit
- Timestamp:
- May 30, 2012, 8:05:34 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r119019 r119030 1 2012-05-30 Stephanie Lewis <slewis@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=87803 4 Layout tests often fail trying to stat nonexistent logs 5 6 Reviewed by Dirk Pranke. 7 8 CrashReporter removes logs using a heuristic to conserve space. Wrap a 9 try/catch block around accessing the logs as a precaution. 10 11 * Scripts/webkitpy/common/system/crashlogs.py: 12 (CrashLogs._find_newest_log_darwin): 13 1 14 2012-05-30 Gavin Peters <gavinp@chromium.org> 2 15 -
trunk/Tools/Scripts/webkitpy/common/system/crashlogs.py
r115977 r119030 57 57 errors = '' 58 58 for path in reversed(sorted(logs)): 59 if not newer_than or self._host.filesystem.mtime(path) > newer_than:60 try:59 try: 60 if not newer_than or self._host.filesystem.mtime(path) > newer_than: 61 61 f = self._host.filesystem.read_text_file(path) 62 62 match = first_line_regex.match(f[0:f.find('\n')]) 63 63 if match and match.group('process_name') == process_name and (pid is None or int(match.group('pid')) == pid): 64 64 return errors + f 65 except IOError, e: 66 if include_errors: 67 errors += "ERROR: Failed to read '%s': %s\n" % (path, str(e)) 65 except IOError, e: 66 if include_errors: 67 errors += "ERROR: Failed to read '%s': %s\n" % (path, str(e)) 68 except OSError, e: 69 if include_errors: 70 errors += "ERROR: Failed to read '%s': %s\n" % (path, str(e)) 68 71 69 72 if include_errors and errors: -
trunk/Tools/Scripts/webkitpy/common/system/crashlogs_unittest.py
r115977 r119030 76 76 self.assertEqual(a.splitlines(), b.splitlines()) 77 77 78 78 79 def test_find_log_darwin(self): 79 80 if not SystemHost().platform.is_mac(): … … 106 107 107 108 def bad_read(path): 108 raise IOError('No such file or directory') 109 raise IOError('IOError: No such file or directory') 110 111 def bad_mtime(path): 112 raise OSError('OSError: No such file or directory') 109 113 110 114 filesystem.read_text_file = bad_read 111 115 log = crash_logs.find_newest_log("DumpRenderTree", 28531, include_errors=True) 112 self.assertTrue('No such file or directory' in log) 116 self.assertTrue('IOError: No such file or directory' in log) 117 118 filesystem = MockFileSystem(files) 119 crash_logs = CrashLogs(MockSystemHost(filesystem=filesystem)) 120 filesystem.mtime = bad_mtime 121 log = crash_logs.find_newest_log("DumpRenderTree", newer_than=1.0, include_errors=True) 122 self.assertTrue('OSError: No such file or directory' in log)
Note:
See TracChangeset
for help on using the changeset viewer.