Changeset 90074 in webkit


Ignore:
Timestamp:
Jun 29, 2011 5:42:39 PM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-06-29 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

new-run-webkit-tests doesn't support sample-on-timeout
https://bugs.webkit.org/show_bug.cgi?id=56731

  • Scripts/webkitpy/layout_tests/port/server_process.py:
  • Scripts/webkitpy/layout_tests/port/server_process_unittest.py:
  • Scripts/webkitpy/layout_tests/run_webkit_tests.py:
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r90070 r90074  
     12011-06-29  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        new-run-webkit-tests doesn't support sample-on-timeout
     6        https://bugs.webkit.org/show_bug.cgi?id=56731
     7
     8        * Scripts/webkitpy/layout_tests/port/server_process.py:
     9        * Scripts/webkitpy/layout_tests/port/server_process_unittest.py:
     10        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
     11
    1122011-06-29  Eric Seidel  <eric@webkit.org>
    213
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/server_process.py

    r89899 r90074  
    4242from webkitpy.common.system.executive import Executive
    4343
    44 _log = logging.getLogger("webkitpy.layout_tests.port.server_process")
     44_log = logging.getLogger(__file__)
    4545
    4646
     
    167167            self.handle_interrupt()
    168168
     169    def _sample(self):
     170        if sys.platform != "darwin":
     171            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        ])
     182
    169183    def _read(self, timeout, size):
    170184        """Internal routine that actually does the read."""
     
    185199                        self._check_for_crash()
    186200                self.timed_out = True
     201                if not self.crashed:
     202                    self._sample()
    187203
    188204            # Check to see if we have any output we can return.
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py

    r77592 r90074  
    2727# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828
     29import sys
    2930import unittest
    3031
    3132from webkitpy.layout_tests.port import server_process
     33from webkitpy.common.system.executive_mock import MockExecutive2
     34from webkitpy.common.system.outputcapture import OutputCapture
     35
     36
     37def _logging_run_command(args):
     38    print args
     39
     40
     41class TrivialMockPort(object):
     42    def results_directory(self):
     43        return "/mock/results"
    3244
    3345
     
    7385        self.assertEquals(server_process.broken_pipes, [server_process.stdin])
    7486
    75 
    76 if __name__ == '__main__':
    77     unittest.main()
     87    def test_sample_process(self):
     88        # Currently, sample-on-timeout only works on Darwin.
     89        if sys.platform != "darwin":
     90            return
     91        server_process = FakeServerProcess(port_obj=TrivialMockPort(), name="test", cmd=["test"], executive=MockExecutive2(run_command_fn=_logging_run_command))
     92        server_process._proc = MockProc(server_process)
     93        expected_stdout = "['/usr/bin/sample', 1, 10, 10, '-file', '/mock/results/test-1.sample.txt']\n"
     94        OutputCapture().assert_outputs(self, server_process._sample, expected_stdout=expected_stdout)
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

    r90055 r90074  
    277277    # FIXME: Need: -g, --guard for guard malloc support on Mac.
    278278    # FIXME: Need: -l --leaks    Enable leaks checking.
    279     # FIXME: Need: --sample-on-timeout Run sample on timeout
    280279
    281280    old_run_webkit_tests_compat = [
    282         # NRWT doesn't sample on timeout yet anyway.
    283         _compat_shim_option("--no-sample-on-timeout"),
    284281        # FIXME: NRWT needs to support remote links eventually.
    285282        _compat_shim_option("--use-remote-links-to-tests"),
     
    293290        optparse.make_option("--no-pixel-tests", action="store_false",
    294291            dest="pixel_tests", help="Disable pixel-to-pixel PNG comparisons"),
     292        optparse.make_option("--no-sample-on-timeout", action="store_false",
     293            dest="sample_on_timeout", help="Don't run sample on timeout (Mac OS X only)"),
    295294        optparse.make_option("--tolerance",
    296295            help="Ignore image differences less than this percentage (some "
Note: See TracChangeset for help on using the changeset viewer.