Changeset 121239 in webkit


Ignore:
Timestamp:
Jun 26, 2012 1:25:11 AM (12 years ago)
Author:
kkristof@inf.u-szeged.hu
Message:

Unreviewed, rolling out r121236.
http://trac.webkit.org/changeset/121236
https://bugs.webkit.org/show_bug.cgi?id=89956

It's broke the nrwt on qt and gtk platform (Requested by
kkristof on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-06-26

  • Scripts/webkitpy/layout_tests/port/qt.py:

(QtPort._build_driver):

  • Scripts/webkitpy/layout_tests/port/xvfbdriver.py:

(XvfbDriver._start):
(XvfbDriver._start.x_filter):
(XvfbDriver.stop):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r121236 r121239  
     12012-06-26  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r121236.
     4        http://trac.webkit.org/changeset/121236
     5        https://bugs.webkit.org/show_bug.cgi?id=89956
     6
     7        It's broke the nrwt on qt and gtk platform (Requested by
     8        kkristof on #webkit).
     9
     10        * Scripts/webkitpy/layout_tests/port/qt.py:
     11        (QtPort._build_driver):
     12        * Scripts/webkitpy/layout_tests/port/xvfbdriver.py:
     13        (XvfbDriver._start):
     14        (XvfbDriver._start.x_filter):
     15        (XvfbDriver.stop):
     16
    1172012-06-26  Kristóf Kosztyó  <kkristof@inf.u-szeged.hu>
    218
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py

    r121236 r121239  
    8181        # The Qt port builds DRT as part of the main build step
    8282        return True
    83 
    84     def _driver_class(self):
    85         return XvfbDriver
    8683
    8784    def _path_to_driver(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py

    r121236 r121239  
    3535from webkitpy.layout_tests.port.webkit import WebKitDriver
    3636from webkitpy.common.system.executive import Executive
    37 from webkitpy.common.system.file_lock import FileLock
    38 from webkitpy.common.system.filesystem import FileSystem
    3937
    4038_log = logging.getLogger(__name__)
     
    4240
    4341class XvfbDriver(WebKitDriver):
    44     def __init__(self, *args, **kwargs):
    45         WebKitDriver.__init__(self, *args, **kwargs)
    46         self._guard_lock = None
    47 
    4842    def _start(self, pixel_tests, per_test_args):
    4943
    50         def next_free_id():
    51             for i in range(99):
    52                 if not os.path.exists('/tmp/.X%d-lock' % i):
    53                     self._guard_lock = FileLock(self._port._filesystem.join('/tmp', 'WebKitXvfb.lock.%i' % i))
    54                     if self._guard_lock.acquire_lock():
    55                         return i
     44        # Collect the number of X servers running already and make
     45        # sure our Xvfb process doesn't clash with any of them.
     46        def x_filter(process_name):
     47            return process_name.find("Xorg") > -1
    5648
    57         self._display_id = next_free_id()
    58         _log.debug('Start new xvfb with id %d for worker/%d' % (self._display_id, self._worker_number))
    59         run_xvfb = ["Xvfb", ":%d" % (self._display_id), "-screen",  "0", "800x600x24", "-nolisten", "tcp"]
     49        running_displays = len(Executive().running_pids(x_filter))
     50
     51        # Use even displays for pixel tests and odd ones otherwise. When pixel tests are disabled,
     52        # DriverProxy creates two drivers, one for normal and the other for ref tests. Both have
     53        # the same worker number, so this prevents them from using the same Xvfb instance.
     54        display_id = self._worker_number * 2 + running_displays
     55        if pixel_tests:
     56            display_id += 1
     57        run_xvfb = ["Xvfb", ":%d" % (display_id), "-screen",  "0", "800x600x24", "-nolisten", "tcp"]
    6058        with open(os.devnull, 'w') as devnull:
    6159            self._xvfb_process = subprocess.Popen(run_xvfb, stderr=devnull)
    62         self._driver_tempdir = self._port._filesystem.mkdtemp(prefix='%s-' % self._port.driver_name())
    6360        server_name = self._port.driver_name()
    6461        environment = self._port.setup_environ_for_server(server_name)
    6562        # We must do this here because the DISPLAY number depends on _worker_number
    66         environment['DISPLAY'] = ":%d" % (self._display_id)
    67         environment['DYLD_LIBRARY_PATH'] = self._port._build_path()
    68         environment['DYLD_FRAMEWORK_PATH'] = self._port._build_path()
    69         # FIXME: We're assuming that WebKitTestRunner checks this DumpRenderTree-named environment variable.
    70         environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
    71         environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
     63        environment['DISPLAY'] = ":%d" % (display_id)
    7264        self._crashed_process_name = None
    7365        self._crashed_pid = None
     
    7668    def stop(self):
    7769        WebKitDriver.stop(self)
    78         if self._guard_lock:
    79             self._guard_lock.release_lock()
    80             self._guard_lock = None
    8170        if getattr(self, '_xvfb_process', None):
    8271            try:
Note: See TracChangeset for help on using the changeset viewer.