Changeset 79062 in webkit


Ignore:
Timestamp:
Feb 18, 2011 6:18:40 PM (13 years ago)
Author:
dpranke@chromium.org
Message:

2011-02-18 Dirk Pranke <dpranke@chromium.org>

Reviewed by James Robinson.

new-run-webkit-tests: enable multiple processes by default on
mac. This change removes the artificial restrictions we placed
on the # of child processes we used with the old threading
model, and switches to the new message-based model and multiple
processes, where available. If multiple processes are not
available (Leopard / Python 2.5), then we use the 'inline' model
instead of the 'old-threads' model on the 'mac' port or one
process on the 'chromium-mac' port. We need additional testing
to see if the new 'threads' model works reliably and is worth
supporting, or if we should just live with things being slightly
slow.

https://bugs.webkit.org/show_bug.cgi?id=54596

  • Scripts/webkitpy/layout_tests/port/chromium_mac.py:
  • Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py:
  • Scripts/webkitpy/layout_tests/port/mac.py:
  • Scripts/webkitpy/layout_tests/port/mac_unittest.py:
  • Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
Location:
trunk/Tools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r79055 r79062  
     12011-02-18  Dirk Pranke  <dpranke@chromium.org>
     2
     3        Reviewed by James Robinson.
     4
     5        new-run-webkit-tests: enable multiple processes by default on
     6        mac. This change removes the artificial restrictions we placed
     7        on the # of child processes we used with the old threading
     8        model, and switches to the new message-based model and multiple
     9        processes, where available. If multiple processes are not
     10        available (Leopard / Python 2.5), then we use the 'inline' model
     11        instead of the 'old-threads' model on the 'mac' port or one
     12        process on the 'chromium-mac' port. We need additional testing
     13        to see if the new 'threads' model works reliably and is worth
     14        supporting, or if we should just live with things being slightly
     15        slow.
     16
     17        https://bugs.webkit.org/show_bug.cgi?id=54596
     18
     19        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
     20        * Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py:
     21        * Scripts/webkitpy/layout_tests/port/mac.py:
     22        * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
     23        * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
     24
    1252011-02-18  Andrew Wilson  <atwilson@chromium.org>
    226
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py

    r79055 r79062  
    3434import signal
    3535
     36# Handle Python < 2.6 where multiprocessing isn't available.
     37try:
     38    import multiprocessing
     39except ImportError:
     40    multiprocessing = None
     41
    3642from webkitpy.layout_tests.port import mac
    3743from webkitpy.layout_tests.port import chromium
     
    100106        return result
    101107
    102     def default_child_processes(self):
    103         if self.get_option('worker_model') == 'old-threads':
    104             # FIXME: we need to run single-threaded for now. See
    105             # https://bugs.webkit.org/show_bug.cgi?id=38553. Unfortunately this
    106             # routine is called right before the logger is configured, so if we
    107             # try to _log.warning(), it gets thrown away.
    108             import sys
    109             sys.stderr.write("Defaulting to one child - see https://bugs.webkit.org/show_bug.cgi?id=38553\n")
    110             return 1
    111 
    112         return chromium.ChromiumPort.default_child_processes(self)
     108    def default_worker_model(self):
     109        if multiprocessing:
     110            return 'processes'
     111        return 'inline'
    113112
    114113    def driver_name(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py

    r79035 r79062  
    2929import unittest
    3030
     31# Handle Python < 2.6 where multiprocessing isn't available.
     32try:
     33    import multiprocessing
     34except ImportError:
     35    multiprocessing = None
     36
    3137from webkitpy.thirdparty.mock import Mock
    3238
     
    4652        # Currently is always true, just logs if missing.
    4753        self.assertTrue(port._check_wdiff_install())
     54
     55    def test_check_default_worker_model(self):
     56        port = chromium_mac.ChromiumMacPort()
     57        if multiprocessing:
     58            self.assertEqual(port.default_worker_model(), 'processes')
     59        else:
     60            self.assertEqual(port.default_worker_model(), 'inline')
    4861
    4962    def assert_name(self, port_name, os_version_string, expected):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py

    r79055 r79062  
    3333import platform
    3434import signal
     35
     36# Handle Python < 2.6 where multiprocessing isn't available.
     37try:
     38    import multiprocessing
     39except ImportError:
     40    multiprocessing = None
     41
    3542
    3643from webkitpy.layout_tests.port.webkit import WebKitPort
     
    8491        WebKitPort.__init__(self, port_name=port_name, **kwargs)
    8592
    86     def default_child_processes(self):
    87         # FIXME: new-run-webkit-tests is unstable on Mac running more than
    88         # four threads in parallel.
    89         # See https://bugs.webkit.org/show_bug.cgi?id=36622
    90         child_processes = WebKitPort.default_child_processes(self)
    91         if self.get_option('worker_model') == 'old-threads' and child_processes > 4:
    92             return 4
    93         return child_processes
     93    def default_worker_model(self):
     94        if multiprocessing:
     95            return 'processes'
     96        return 'inline'
    9497
    9598    def baseline_search_path(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py

    r79045 r79062  
    3131import unittest
    3232
     33# Handle Python < 2.6 where multiprocessing isn't available.
     34try:
     35    import multiprocessing
     36except ImportError:
     37    multiprocessing = None
     38
    3339from webkitpy.layout_tests.port import mac
    3440from webkitpy.layout_tests.port import port_testcase
     
    4854        relative_paths = [path[len(port.path_from_webkit_base()):] for path in skipped_paths]
    4955        self.assertEqual(relative_paths, expected_paths)
     56
     57    def test_default_worker_model(self):
     58        port = mac.MacPort()
     59        if multiprocessing:
     60            self.assertEqual(port.default_worker_model(), 'processes')
     61        else:
     62            self.assertEqual(port.default_worker_model(), 'inline')
    5063
    5164    def test_skipped_file_paths(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py

    r78944 r79062  
    4343import unittest
    4444
     45try:
     46    import multiprocessing
     47except ImportError:
     48    multiprocessing = None
     49
    4550from webkitpy.common import array_stream
    4651from webkitpy.common.system import outputcapture
     
    470475        # FIXME: remove this when we fix test-webkitpy to work properly
    471476        # with the multiprocessing module (bug 54520).
    472         if compare_version(sys, '2.6')[0] >= 0 and sys.platform not in ('cygwin', 'win32'):
     477        if multiprocessing and sys.platform not in ('cygwin', 'win32'):
    473478            self.assertTrue(passing_run(['--worker-model', 'processes']))
    474479
    475480    def test_worker_model__processes_and_dry_run(self):
    476         if compare_version(sys, '2.6')[0] >= 0 and sys.platform not in ('cygwin', 'win32'):
     481        if multiprocessing and sys.platform not in ('cygwin', 'win32'):
    477482            self.assertTrue(passing_run(['--worker-model', 'processes', '--dry-run']))
    478483
Note: See TracChangeset for help on using the changeset viewer.