Commit 2ffcfc8e authored by zandobersek@gmail.com's avatar zandobersek@gmail.com
Browse files

[XvfbDriver] First tests in each worker occasionally crash

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

Reviewed by Dirk Pranke.

Often in debug builds, the first tests in each worker crash because they
can't yet open the Xvfb display assigned to them. This indicates Xvfb hasn't
yet been set up.

To avoid this, the execution should halt for a small amount of time before tests
are run so the Xvfb process has enough time to get ready. At the moment this is
done right after the Xvfb process is spawned and the execution halts for one
second. That value is overriden to zero when testing to not prolong the testing time.

* Scripts/webkitpy/layout_tests/port/xvfbdriver.py:
(XvfbDriver.__init__):
(XvfbDriver._start):
* Scripts/webkitpy/layout_tests/port/xvfbdriver_unittest.py:
(XvfbDriverTest.make_driver):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b166c95b
2012-10-02 Zan Dobersek <zandobersek@gmail.com>
[XvfbDriver] First tests in each worker occasionally crash
https://bugs.webkit.org/show_bug.cgi?id=96203
Reviewed by Dirk Pranke.
Often in debug builds, the first tests in each worker crash because they
can't yet open the Xvfb display assigned to them. This indicates Xvfb hasn't
yet been set up.
To avoid this, the execution should halt for a small amount of time before tests
are run so the Xvfb process has enough time to get ready. At the moment this is
done right after the Xvfb process is spawned and the execution halts for one
second. That value is overriden to zero when testing to not prolong the testing time.
* Scripts/webkitpy/layout_tests/port/xvfbdriver.py:
(XvfbDriver.__init__):
(XvfbDriver._start):
* Scripts/webkitpy/layout_tests/port/xvfbdriver_unittest.py:
(XvfbDriverTest.make_driver):
2012-10-02 Christophe Dumez <christophe.dumez@intel.com>
 
[EFL] Use XvfbDriver for layout tests
......@@ -29,6 +29,7 @@
import logging
import os
import re
import time
from webkitpy.layout_tests.port.server_process import ServerProcess
from webkitpy.layout_tests.port.driver import Driver
......@@ -41,6 +42,7 @@ class XvfbDriver(Driver):
def __init__(self, *args, **kwargs):
Driver.__init__(self, *args, **kwargs)
self._guard_lock = None
self._startup_delay_secs = 1.0
def _next_free_display(self):
running_pids = self._port.host.executive.run_command(['ps', '-eo', 'comm,command'])
......@@ -67,6 +69,10 @@ class XvfbDriver(Driver):
with open(os.devnull, 'w') as devnull:
self._xvfb_process = self._port.host.executive.popen(run_xvfb, stderr=devnull)
# Crashes intend to occur occasionally in the first few tests that are run through each
# worker because the Xvfb display isn't ready yet. Halting execution a bit should avoid that.
time.sleep(self._startup_delay_secs)
server_name = self._port.driver_name()
environment = self._port.setup_environ_for_server(server_name)
# We must do this here because the DISPLAY number depends on _worker_number
......
......@@ -47,6 +47,7 @@ class XvfbDriverTest(unittest.TestCase):
port._executive._running_pids['Xorg'] = 108
driver = XvfbDriver(port, worker_number=worker_number, pixel_tests=True)
driver._startup_delay_secs = 0
return driver
def cleanup_driver(self, driver):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment