Changeset 90184 in webkit
- Timestamp:
- Jun 30, 2011 4:40:32 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r90178 r90184 1 2011-06-30 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 Clean up output from new-run-webkit-tests 6 https://bugs.webkit.org/show_bug.cgi?id=63759 7 8 Printing messages from the child process looks super ugly because of 9 the way the pretty-printer works. Printing a blank line first is a 10 hack, but it makes things at least partially sane. 11 12 Also, handle the case where calling sample throws an exception. 13 14 * Scripts/webkitpy/layout_tests/port/server_process.py: 15 * Scripts/webkitpy/layout_tests/port/server_process_unittest.py: 16 1 17 2011-06-27 Diego Gonzalez <diegohcg@webkit.org> 2 18 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/server_process.py
r90074 r90184 40 40 import fcntl 41 41 42 from webkitpy.common.system.executive import Executive 42 from webkitpy.common.system.executive import Executive, ScriptError 43 43 44 44 _log = logging.getLogger(__file__) … … 167 167 self.handle_interrupt() 168 168 169 def _log(self, message): 170 # This is a bit of a hack, but we first log a blank line to avoid 171 # messing up the master process's output. 172 _log.info('') 173 _log.info(message) 174 169 175 def _sample(self): 170 176 if sys.platform != "darwin": 171 177 return 172 _log.warning('Sampling process... (use --no-sample-on-timeout to skip this step)') 173 hang_report = os.path.join(self._port.results_directory(), "%s-%s.sample.txt" % (self._name, self._proc.pid)) 174 self._executive.run_command([ 175 "/usr/bin/sample", 176 self._proc.pid, 177 10, 178 10, 179 "-file", 180 hang_report, 181 ]) 178 try: 179 self._log('Sampling %s process... (use --no-sample-on-timeout to skip this step)' % self._name) 180 hang_report = os.path.join(self._port.results_directory(), "%s-%s.sample.txt" % (self._name, self._proc.pid)) 181 self._executive.run_command([ 182 "/usr/bin/sample", 183 self._proc.pid, 184 10, 185 10, 186 "-file", 187 hang_report, 188 ]) 189 except ScriptError, e: 190 self._log('Unable to sample process.') 182 191 183 192 def _read(self, timeout, size): … … 194 203 if now > deadline: 195 204 if self._executive.running_pids(self._port.is_crash_reporter): 196 _log.warning('Waiting for crash reporter...')205 self._log('Waiting for crash reporter...') 197 206 self._executive.wait_newest(self._port.is_crash_reporter) 198 207 if not self.crashed: -
trunk/Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py
r90074 r90184 31 31 32 32 from webkitpy.layout_tests.port import server_process 33 from webkitpy.common.system.executive import ScriptError 33 34 from webkitpy.common.system.executive_mock import MockExecutive2 34 35 from webkitpy.common.system.outputcapture import OutputCapture … … 37 38 def _logging_run_command(args): 38 39 print args 40 41 42 def _throwing_run_command(args): 43 raise ScriptError("MOCK script error") 39 44 40 45 … … 93 98 expected_stdout = "['/usr/bin/sample', 1, 10, 10, '-file', '/mock/results/test-1.sample.txt']\n" 94 99 OutputCapture().assert_outputs(self, server_process._sample, expected_stdout=expected_stdout) 100 101 def test_sample_process_throws_exception(self): 102 # Currently, sample-on-timeout only works on Darwin. 103 if sys.platform != "darwin": 104 return 105 server_process = FakeServerProcess(port_obj=TrivialMockPort(), name="test", cmd=["test"], executive=MockExecutive2(run_command_fn=_throwing_run_command)) 106 server_process._proc = MockProc(server_process) 107 OutputCapture().assert_outputs(self, server_process._sample)
Note: See TracChangeset
for help on using the changeset viewer.