Changeset 245824 in webkit


Ignore:
Timestamp:
May 28, 2019 2:04:44 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

webkitpy: Switch run-webkit-tests to tailspin
https://bugs.webkit.org/show_bug.cgi?id=198144
<rdar://problem/32463212>

Patch by David Xiong <w_xiong@apple.com> on 2019-05-28
Reviewed by Jonathan Bedard.

Changes run-webkit-tests to run tailspin on test time out
rather than spindump, and edited tests to look for tailspin logs
instead.

  • Scripts/webkitpy/port/darwin.py:

(DarwinPort.sample_process): Replaced spindump with tailspin (+ symbolication)
(DarwinPort):
(DarwinPort.tailspin_file_path):
(DarwinTest.spindump_file_path): Deleted.

  • Scripts/webkitpy/port/darwin_testcase.py:

(DarwinTest.test_tailspin): Changed spindump test (below) to test for tailspin instead
(DarwinTest.test_spindump): Deleted.
(DarwinTest.test_spindump.logging_run_command): Deleted.

  • Scripts/webkitpy/port/ios_device_unittest.py:

(IOSDeviceTest.test_tailspin): Changed spindump tests (inc. below) to test for tailspin instead
(IOSDeviceTest.test_sample_process.logging_run_command):
(IOSDeviceTest.test_sample_process_exception.throwing_run_command):
(IOSDeviceTest.test_spindump): Deleted.
(IOSDeviceTest.test_spindump.logging_run_command): Deleted.

Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r245819 r245824  
     12019-05-28  David Xiong  <w_xiong@apple.com>
     2
     3        webkitpy: Switch run-webkit-tests to tailspin
     4        https://bugs.webkit.org/show_bug.cgi?id=198144
     5        <rdar://problem/32463212>
     6
     7        Reviewed by Jonathan Bedard.
     8
     9        Changes run-webkit-tests to run tailspin on test time out
     10        rather than spindump, and edited tests to look for tailspin logs
     11        instead.
     12
     13        * Scripts/webkitpy/port/darwin.py:
     14        (DarwinPort.sample_process): Replaced spindump with tailspin (+ symbolication)
     15        (DarwinPort):
     16        (DarwinPort.tailspin_file_path):
     17        (DarwinTest.spindump_file_path): Deleted.
     18        * Scripts/webkitpy/port/darwin_testcase.py:
     19        (DarwinTest.test_tailspin): Changed spindump test (below) to test for tailspin instead
     20        (DarwinTest.test_spindump): Deleted.
     21        (DarwinTest.test_spindump.logging_run_command): Deleted.
     22        * Scripts/webkitpy/port/ios_device_unittest.py:
     23        (IOSDeviceTest.test_tailspin): Changed spindump tests (inc. below) to test for tailspin instead
     24        (IOSDeviceTest.test_sample_process.logging_run_command):
     25        (IOSDeviceTest.test_sample_process_exception.throwing_run_command):
     26        (IOSDeviceTest.test_spindump): Deleted.
     27        (IOSDeviceTest.test_spindump.logging_run_command): Deleted.
     28
    1292019-05-28  David Xiong  <w_xiong@apple.com>
    230
  • trunk/Tools/Scripts/webkitpy/port/darwin.py

    r245819 r245824  
    161161        host = target_host or self.host
    162162        tempdir = host.filesystem.mkdtemp()
     163        temp_tailspin_file_path = host.filesystem.join(str(tempdir), "{0}-{1}-tailspin-temp.txt".format(name, pid))
    163164        command = [
    164             '/usr/sbin/spindump',
    165             pid,
    166             10,
    167             10,
    168             '-file',
    169             DarwinPort.spindump_file_path(host, name, pid, str(tempdir)),
     165            '/usr/bin/tailspin',
     166            'save',
     167            '-n',
     168            temp_tailspin_file_path,
    170169        ]
    171170        if host.platform.is_mac():
    172171            command = ['/usr/bin/sudo', '-n'] + command
     172
    173173        exit_status = host.executive.run_command(command, return_exit_code=True)
    174         if exit_status:
     174        if not exit_status:  # Symbolicate tailspin log using spindump
     175            try:
     176                host.executive.run_command([
     177                    '/usr/sbin/spindump',
     178                    '-i',
     179                    temp_tailspin_file_path,
     180                    '-file',
     181                    DarwinPort.tailspin_file_path(host, name, pid, str(tempdir)),
     182                ])
     183                host.filesystem.move_to_base_host(DarwinPort.tailspin_file_path(host, name, pid, str(tempdir)),
     184                                                  DarwinPort.tailspin_file_path(self.host, name, pid, self.results_directory()))
     185            except IOError as e:
     186                _log.warning('Unable to symbolicate tailspin log of process:' + str(e))
     187        else:  # Tailspin failed, run sample instead
    175188            try:
    176189                host.executive.run_command([
     
    186199            except ScriptError as e:
    187200                _log.warning('Unable to sample process:' + str(e))
    188         else:
    189             host.filesystem.move_to_base_host(DarwinPort.spindump_file_path(host, name, pid, str(tempdir)),
    190                                               DarwinPort.spindump_file_path(self.host, name, pid, self.results_directory()))
    191201        host.filesystem.rmtree(str(tempdir))
    192202
     
    196206
    197207    @staticmethod
    198     def spindump_file_path(host, name, pid, directory):
    199         return host.filesystem.join(directory, "{0}-{1}-spindump.txt".format(name, pid))
     208    def tailspin_file_path(host, name, pid, directory):
     209        return host.filesystem.join(directory, "{0}-{1}-tailspin.txt".format(name, pid))
    200210
    201211    def look_for_new_samples(self, unresponsive_processes, start_time):
  • trunk/Tools/Scripts/webkitpy/port/darwin_testcase.py

    r225856 r245824  
    9999        self.assertEqual(port.path_to_crash_logs(), '/Users/mock/Library/Logs/DiagnosticReports')
    100100
    101     def test_spindump(self):
     101    def test_tailspin(self):
    102102
    103103        def logging_run_command(args):
     
    105105
    106106        port = self.make_port()
    107         port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-spindump.txt'] = 'Spindump file'
     107        port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin-temp.txt'] = 'Temporary tailspin output file'
     108        port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin.txt'] = 'Symbolocated tailspin file'
    108109        port.host.executive = MockExecutive2(run_command_fn=logging_run_command)
    109         expected_stdout = "['/usr/bin/sudo', '-n', '/usr/sbin/spindump', 42, 10, 10, '-file', '/__im_tmp/tmp_0_/test-42-spindump.txt']\n"
     110        expected_stdout = "['/usr/bin/sudo', '-n', '/usr/bin/tailspin', 'save', '-n', '/__im_tmp/tmp_0_/test-42-tailspin-temp.txt']\n['/usr/sbin/spindump', '-i', '/__im_tmp/tmp_0_/test-42-tailspin-temp.txt', '-file', '/__im_tmp/tmp_0_/test-42-tailspin.txt']\n"
    110111        OutputCapture().assert_outputs(self, port.sample_process, args=['test', 42], expected_stdout=expected_stdout)
    111         self.assertEqual(port.host.filesystem.files['/mock-build/layout-test-results/test-42-spindump.txt'], 'Spindump file')
    112         self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-spindump.txt'])
     112        self.assertEqual(port.host.filesystem.files['/mock-build/layout-test-results/test-42-tailspin.txt'], 'Symbolocated tailspin file')
     113        self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin-temp.txt'])
     114        self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin.txt'])
    113115
    114116    def test_sample_process(self):
  • trunk/Tools/Scripts/webkitpy/port/ios_device_unittest.py

    r239875 r245824  
    4646            port.path_to_crash_logs()
    4747
    48     def test_spindump(self):
     48    def test_tailspin(self):
    4949        def logging_run_command(args):
    5050            print(args)
    5151
    5252        port = self.make_port()
    53         port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-spindump.txt'] = 'Spindump file'
     53        port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin-temp.txt'] = 'Temporary tailspin output file'
     54        port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin.txt'] = 'Symbolocated tailspin file'
    5455        port.host.executive = MockExecutive2(run_command_fn=logging_run_command)
    55         expected_stdout = "['/usr/sbin/spindump', 42, 10, 10, '-file', '/__im_tmp/tmp_0_/test-42-spindump.txt']\n"
     56        expected_stdout = "['/usr/bin/tailspin', 'save', '-n', '/__im_tmp/tmp_0_/test-42-tailspin-temp.txt']\n['/usr/sbin/spindump', '-i', '/__im_tmp/tmp_0_/test-42-tailspin-temp.txt', '-file', '/__im_tmp/tmp_0_/test-42-tailspin.txt']\n"
    5657        OutputCapture().assert_outputs(self, port.sample_process, args=['test', 42], expected_stdout=expected_stdout)
    57         self.assertEqual(port.host.filesystem.files['/mock-build/layout-test-results/test-42-spindump.txt'], 'Spindump file')
    58         self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-spindump.txt'])
     58        self.assertEqual(port.host.filesystem.files['/mock-build/layout-test-results/test-42-tailspin.txt'], 'Symbolocated tailspin file')
     59        self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin-temp.txt'])
     60        self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin.txt'])
    5961
    6062    def test_sample_process(self):
    6163        def logging_run_command(args):
    62             if args[0] == '/usr/sbin/spindump':
     64            if args[0] == '/usr/bin/tailspin':
    6365                return 1
    6466            print(args)
     
    7577    def test_sample_process_exception(self):
    7678        def throwing_run_command(args):
    77             if args[0] == '/usr/sbin/spindump':
     79            if args[0] == '/usr/bin/tailspin':
    7880                return 1
    7981            raise ScriptError('MOCK script error')
Note: See TracChangeset for help on using the changeset viewer.