<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[195032] releases/WebKitGTK/webkit-2.10/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/195032">195032</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-01-14 04:01:17 -0800 (Thu, 14 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/192568">r192568</a> - [XvfbDriver] Fail to run all layout tests when X server started with -displayfd option
https://bugs.webkit.org/show_bug.cgi?id=151135

Reviewed by Darin Adler.

The XvfbDriver uses the x server command line to check the
displays that are currently in use. This doesn't work when X
server was started with -displayfd option. This option is used to let
the server find the display id available that is written to the
given file descriptor. With this option xorg doesn't need to
create the lock files in tmp either. The -displayfd option is also
available in Xvfb, so we could use it too. That would simplify the
code, fixing also race conditions between the check for available
displays and Xvfb opening the connection, we wouldn't need to wait
for 4 seconds after launching Xvfb, and all lock files we are
using won't be needed either.

* Scripts/webkitpy/port/xvfbdriver.py:
(XvfbDriver._xvfb_pipe): Helper function to create the pipe, only
needed to be overriden by unit tests.
(XvfbDriver._xvfb_read_display_id): Helper function to read from
the pipe, only needed to be overriden by unit tests.
(XvfbDriver._xvfb_run): Run Xvfb with -displayfd option, using a
pipe to read the display id.
(XvfbDriver._start): Call _xvfb_run() and remove the code to run
Xvfb for a given display.
(XvfbDriver.stop): Remove code to release and delete file locks.
* Scripts/webkitpy/port/xvfbdriver_unittest.py:
(XvfbDriverTest.make_driver):
(XvfbDriverTest.test_start):
(XvfbDriverTest.test_start_arbitrary_worker_number):
(XvfbDriverTest.test_stop):
(XvfbDriverTest.assertDriverStartSuccessful): Deleted.
(XvfbDriverTest): Deleted.
(XvfbDriverTest.test_stop.FakeXvfbProcess): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit210ToolsChangeLog">releases/WebKitGTK/webkit-2.10/Tools/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210ToolsScriptswebkitpyportxvfbdriverpy">releases/WebKitGTK/webkit-2.10/Tools/Scripts/webkitpy/port/xvfbdriver.py</a></li>
<li><a href="#releasesWebKitGTKwebkit210ToolsScriptswebkitpyportxvfbdriver_unittestpy">releases/WebKitGTK/webkit-2.10/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit210ToolsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Tools/ChangeLog (195031 => 195032)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Tools/ChangeLog        2016-01-14 11:58:39 UTC (rev 195031)
+++ releases/WebKitGTK/webkit-2.10/Tools/ChangeLog        2016-01-14 12:01:17 UTC (rev 195032)
</span><span class="lines">@@ -1,3 +1,54 @@
</span><ins>+2015-11-18  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        Unreviewed. Fix webkitpy tests after r192568.
+
+        Instead of ignoring exception when closing mock fds, use a helper
+        function that the unit test can override to do nothing.
+
+        * Scripts/webkitpy/port/xvfbdriver.py:
+        (XvfbDriver._xvfb_close_pipe):
+        (XvfbDriver._xvfb_run):
+        * Scripts/webkitpy/port/xvfbdriver_unittest.py:
+        (XvfbDriverTest.make_driver):
+
+2015-11-18  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [XvfbDriver] Fail to run all layout tests when X server started with -displayfd option
+        https://bugs.webkit.org/show_bug.cgi?id=151135
+
+        Reviewed by Darin Adler.
+
+        The XvfbDriver uses the x server command line to check the
+        displays that are currently in use. This doesn't work when X
+        server was started with -displayfd option. This option is used to let
+        the server find the display id available that is written to the
+        given file descriptor. With this option xorg doesn't need to
+        create the lock files in tmp either. The -displayfd option is also
+        available in Xvfb, so we could use it too. That would simplify the
+        code, fixing also race conditions between the check for available
+        displays and Xvfb opening the connection, we wouldn't need to wait
+        for 4 seconds after launching Xvfb, and all lock files we are
+        using won't be needed either.
+
+        * Scripts/webkitpy/port/xvfbdriver.py:
+        (XvfbDriver._xvfb_pipe): Helper function to create the pipe, only
+        needed to be overriden by unit tests.
+        (XvfbDriver._xvfb_read_display_id): Helper function to read from
+        the pipe, only needed to be overriden by unit tests.
+        (XvfbDriver._xvfb_run): Run Xvfb with -displayfd option, using a
+        pipe to read the display id.
+        (XvfbDriver._start): Call _xvfb_run() and remove the code to run
+        Xvfb for a given display.
+        (XvfbDriver.stop): Remove code to release and delete file locks.
+        * Scripts/webkitpy/port/xvfbdriver_unittest.py:
+        (XvfbDriverTest.make_driver):
+        (XvfbDriverTest.test_start):
+        (XvfbDriverTest.test_start_arbitrary_worker_number):
+        (XvfbDriverTest.test_stop):
+        (XvfbDriverTest.assertDriverStartSuccessful): Deleted.
+        (XvfbDriverTest): Deleted.
+        (XvfbDriverTest.test_stop.FakeXvfbProcess): Deleted.
+
</ins><span class="cx"> 2015-10-23  Michael Saboff  &lt;msaboff@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r179357-r179359): WebContent Crash using AOL Mail @ com.apple.JavascriptCore JSC::linkPolymorphicCall(JSC::ExecState*, JSC::CallLinkInfo&amp;, JSC::CallVariant, JSC::RegisterPreservationMode) + 1584
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210ToolsScriptswebkitpyportxvfbdriverpy"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Tools/Scripts/webkitpy/port/xvfbdriver.py (195031 => 195032)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Tools/Scripts/webkitpy/port/xvfbdriver.py        2016-01-14 11:58:39 UTC (rev 195031)
+++ releases/WebKitGTK/webkit-2.10/Tools/Scripts/webkitpy/port/xvfbdriver.py        2016-01-14 12:01:17 UTC (rev 195032)
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx"> 
</span><span class="cx"> from webkitpy.port.server_process import ServerProcess
</span><span class="cx"> from webkitpy.port.driver import Driver
</span><del>-from webkitpy.common.system.file_lock import FileLock
</del><span class="cx"> 
</span><span class="cx"> _log = logging.getLogger(__name__)
</span><span class="cx"> 
</span><span class="lines">@@ -50,52 +49,56 @@
</span><span class="cx">             _log.error(&quot;No Xvfb found. Cannot run layout tests.&quot;)
</span><span class="cx">         return xvfb_found
</span><span class="cx"> 
</span><del>-    def __init__(self, *args, **kwargs):
-        Driver.__init__(self, *args, **kwargs)
-        self._guard_lock = None
-        self._startup_delay_secs = 1.0
</del><ins>+    def _xvfb_pipe(self):
+        return os.pipe()
</ins><span class="cx"> 
</span><del>-    def _next_free_display(self):
-        running_pids = self._port.host.executive.run_command(['ps', '-eo', 'comm,command'])
-        reserved_screens = set()
-        for pid in running_pids.split('\n'):
-            match = re.match('(X|Xvfb|Xorg|Xorg\.bin)\s+.*\s:(?P&lt;screen_number&gt;\d+)', pid)
-            if match:
-                reserved_screens.add(int(match.group('screen_number')))
-        for i in range(1, 99):
-            if i not in reserved_screens:
-                _guard_lock_file = self._port.host.filesystem.join('/tmp', 'WebKitXvfb.lock.%i' % i)
-                self._guard_lock = self._port.host.make_file_lock(_guard_lock_file)
-                if self._guard_lock.acquire_lock():
-                    return i
</del><ins>+    def _xvfb_read_display_id(self, read_fd):
+        import errno
+        import select
</ins><span class="cx"> 
</span><del>-    def _xvfb_screen_depth(self):
-        return os.environ.get('XVFB_SCREEN_DEPTH', '24')
</del><ins>+        fd_set = [read_fd]
+        while fd_set:
+            try:
+                fd_list = select.select(fd_set, [], [])[0]
+            except select.error, e:
+                if e.args[0] == errno.EINTR:
+                    continue
+                raise
</ins><span class="cx"> 
</span><del>-    def _start(self, pixel_tests, per_test_args):
-        self.stop()
</del><ins>+            if read_fd in fd_list:
+                # We only expect a number, so first read should be enough.
+                display_id = os.read(read_fd, 256).strip('\n')
+                fd_set = []
</ins><span class="cx"> 
</span><del>-        # Use even displays for pixel tests and odd ones otherwise. When pixel tests are disabled,
-        # DriverProxy creates two drivers, one for normal and the other for ref tests. Both have
-        # the same worker number, so this prevents them from using the same Xvfb instance.
-        display_id = self._next_free_display()
-        self._lock_file = &quot;/tmp/.X%d-lock&quot; % display_id
</del><ins>+        return int(display_id)
</ins><span class="cx"> 
</span><del>-        server_name = self._port.driver_name()
-        environment = self._port.setup_environ_for_server(server_name)
</del><ins>+    def _xvfb_close_pipe(self, pipe_fds):
+        os.close(pipe_fds[0])
+        os.close(pipe_fds[1])
</ins><span class="cx"> 
</span><del>-        run_xvfb = [&quot;Xvfb&quot;, &quot;:%d&quot; % display_id, &quot;-screen&quot;,  &quot;0&quot;, &quot;1024x768x%s&quot; % self._xvfb_screen_depth(), &quot;-nolisten&quot;, &quot;tcp&quot;]
-
</del><ins>+    def _xvfb_run(self, environment):
+        read_fd, write_fd = self._xvfb_pipe()
+        run_xvfb = [&quot;Xvfb&quot;, &quot;-displayfd&quot;, str(write_fd), &quot;-screen&quot;,  &quot;0&quot;, &quot;1024x768x%s&quot; % self._xvfb_screen_depth(), &quot;-nolisten&quot;, &quot;tcp&quot;]
</ins><span class="cx">         if self._port._should_use_jhbuild():
</span><del>-                run_xvfb = self._port._jhbuild_wrapper + run_xvfb
-
</del><ins>+            run_xvfb = self._port._jhbuild_wrapper + run_xvfb
</ins><span class="cx">         with open(os.devnull, 'w') as devnull:
</span><span class="cx">             self._xvfb_process = self._port.host.executive.popen(run_xvfb, stderr=devnull, env=environment)
</span><ins>+            display_id = self._xvfb_read_display_id(read_fd)
</ins><span class="cx"> 
</span><del>-        # 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)
</del><ins>+        self._xvfb_close_pipe((read_fd, write_fd))
</ins><span class="cx"> 
</span><ins>+        return display_id
+
+    def _xvfb_screen_depth(self):
+        return os.environ.get('XVFB_SCREEN_DEPTH', '24')
+
+    def _start(self, pixel_tests, per_test_args):
+        self.stop()
+
+        server_name = self._port.driver_name()
+        environment = self._port.setup_environ_for_server(server_name)
+        display_id = self._xvfb_run(environment)
+
</ins><span class="cx">         # We must do this here because the DISPLAY number depends on _worker_number
</span><span class="cx">         environment['DISPLAY'] = &quot;:%d&quot; % display_id
</span><span class="cx">         self._driver_tempdir = self._port.host.filesystem.mkdtemp(prefix='%s-' % self._port.driver_name())
</span><span class="lines">@@ -115,11 +118,6 @@
</span><span class="cx"> 
</span><span class="cx">     def stop(self):
</span><span class="cx">         super(XvfbDriver, self).stop()
</span><del>-        if self._guard_lock:
-            self._guard_lock.release_lock()
-            self._guard_lock = None
</del><span class="cx">         if getattr(self, '_xvfb_process', None):
</span><span class="cx">             self._port.host.executive.kill_process(self._xvfb_process.pid)
</span><span class="cx">             self._xvfb_process = None
</span><del>-            if self._port.host.filesystem.exists(self._lock_file):
-                self._port.host.filesystem.remove(self._lock_file)
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit210ToolsScriptswebkitpyportxvfbdriver_unittestpy"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py (195031 => 195032)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py        2016-01-14 11:58:39 UTC (rev 195031)
+++ releases/WebKitGTK/webkit-2.10/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py        2016-01-14 12:01:17 UTC (rev 195032)
</span><span class="lines">@@ -52,6 +52,9 @@
</span><span class="cx">         driver = XvfbDriver(port, worker_number=worker_number, pixel_tests=True)
</span><span class="cx">         driver._startup_delay_secs = 0
</span><span class="cx">         driver._xvfb_screen_depth = lambda: '24'
</span><ins>+        driver._xvfb_pipe = lambda: (3, 4)
+        driver._xvfb_read_display_id = lambda x: 1
+        driver._xvfb_close_pipe = lambda p: None
</ins><span class="cx">         driver._environment = port.setup_environ_for_server(port.driver_name())
</span><span class="cx">         return driver
</span><span class="cx"> 
</span><span class="lines">@@ -66,71 +69,20 @@
</span><span class="cx">         self.assertTrue(driver._server_process.started)
</span><span class="cx">         self.assertEqual(driver._server_process.env[&quot;DISPLAY&quot;], expected_display)
</span><span class="cx"> 
</span><del>-    def test_start_no_pixel_tests(self):
</del><ins>+    def test_start(self):
</ins><span class="cx">         driver = self.make_driver()
</span><del>-        expected_logs = (&quot;MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':1', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n&quot; % driver._environment)
</del><ins>+        expected_logs = (&quot;MOCK popen: ['Xvfb', '-displayfd', '4', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n&quot; % driver._environment)
</ins><span class="cx">         self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=&quot;:1&quot;)
</span><span class="cx">         self.cleanup_driver(driver)
</span><span class="cx"> 
</span><del>-    def test_start_pixel_tests(self):
-        driver = self.make_driver()
-        expected_logs = (&quot;MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':1', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n&quot; % driver._environment)
-        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=&quot;:1&quot;, pixel_tests=True)
-        self.cleanup_driver(driver)
-
</del><span class="cx">     def test_start_arbitrary_worker_number(self):
</span><span class="cx">         driver = self.make_driver(worker_number=17)
</span><del>-        expected_logs = (&quot;MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':1', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n&quot; % driver._environment)
</del><ins>+        expected_logs = (&quot;MOCK popen: ['Xvfb', '-displayfd', '4', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n&quot; % driver._environment)
</ins><span class="cx">         self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=&quot;:1&quot;, pixel_tests=True)
</span><span class="cx">         self.cleanup_driver(driver)
</span><span class="cx"> 
</span><del>-    def test_next_free_display(self):
-        output = &quot;Xorg            /usr/bin/X :1 -auth /var/run/lightdm/root/:1 -nolisten tcp vt7 -novtswitch -background none\nXvfb            Xvfb :2 -screen 0 800x600x24 -nolisten tcp&quot;
-        executive = MockExecutive2(output)
-        driver = self.make_driver(executive=executive)
-        self.assertEqual(driver._next_free_display(), 3)
-        self.cleanup_driver(driver)
-        output = &quot;X               /usr/bin/X :1 vt7 -nolisten tcp -auth /var/run/xauth/A:0-8p7Ybb&quot;
-        executive = MockExecutive2(output)
-        driver = self.make_driver(executive=executive)
-        self.assertEqual(driver._next_free_display(), 2)
-        self.cleanup_driver(driver)
-        output = &quot;Xvfb            Xvfb :1 -screen 0 800x600x24 -nolisten tcp&quot;
-        executive = MockExecutive2(output)
-        driver = self.make_driver(executive=executive)
-        self.assertEqual(driver._next_free_display(), 2)
-        self.cleanup_driver(driver)
-        output = &quot;Xvfb            Xvfb :2 -screen 0 800x600x24 -nolisten tcp\nXvfb            Xvfb :1 -screen 0 800x600x24 -nolisten tcp\nXvfb            Xvfb :3 -screen 0 800x600x24 -nolisten tcp&quot;
-        executive = MockExecutive2(output)
-        driver = self.make_driver(executive=executive)
-        self.assertEqual(driver._next_free_display(), 4)
-        self.cleanup_driver(driver)
-        output = &quot;Xorg.bin        /usr/libexec/Xorg.bin :1 -background none -noreset -verbose 3 -logfile /dev/null -auth /run/gdm/auth-for-gdm-Zt8Eq2/database -seat seat0 -nolisten tcp vt1&quot;
-        executive = MockExecutive2(output)
-        driver = self.make_driver(executive=executive)
-        self.assertEqual(driver._next_free_display(), 2)
-        self.cleanup_driver(driver)
-        output = &quot;/usr/libexec/Xorg            vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -verbose 3&quot;
-        executive = MockExecutive2(output)
-        driver = self.make_driver(executive=executive)
-        self.assertEqual(driver._next_free_display(), 1)
-        self.cleanup_driver(driver)
-
-    def test_start_next_worker(self):
-        driver = self.make_driver()
-        driver._next_free_display = lambda: 1
-        expected_logs = (&quot;MOCK popen: ['Xvfb', ':1', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n&quot; % driver._environment)
-        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=&quot;:1&quot;, pixel_tests=True)
-        self.cleanup_driver(driver)
-        driver = self.make_driver()
-        driver._next_free_display = lambda: 3
-        expected_logs = (&quot;MOCK popen: ['Xvfb', ':3', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n&quot; % driver._environment)
-        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=&quot;:3&quot;, pixel_tests=True)
-        self.cleanup_driver(driver)
-
</del><span class="cx">     def test_stop(self):
</span><del>-        filesystem = MockFileSystem(files={'/tmp/.X42-lock': '1234\n'})
-        port = Port(MockSystemHost(log_executive=True, filesystem=filesystem), 'xvfbdrivertestport', options=MockOptions(configuration='Release'))
</del><ins>+        port = Port(MockSystemHost(log_executive=True), 'xvfbdrivertestport', options=MockOptions(configuration='Release'))
</ins><span class="cx">         port._executive.kill_process = lambda x: _log.info(&quot;MOCK kill_process pid: &quot; + str(x))
</span><span class="cx">         driver = XvfbDriver(port, worker_number=0, pixel_tests=True)
</span><span class="cx"> 
</span><span class="lines">@@ -138,10 +90,8 @@
</span><span class="cx">             pid = 1234
</span><span class="cx"> 
</span><span class="cx">         driver._xvfb_process = FakeXvfbProcess()
</span><del>-        driver._lock_file = '/tmp/.X42-lock'
</del><span class="cx"> 
</span><span class="cx">         expected_logs = &quot;MOCK kill_process pid: 1234\n&quot;
</span><span class="cx">         OutputCapture().assert_outputs(self, driver.stop, [], expected_logs=expected_logs)
</span><span class="cx"> 
</span><span class="cx">         self.assertIsNone(driver._xvfb_process)
</span><del>-        self.assertFalse(port._filesystem.exists(driver._lock_file))
</del></span></pre>
</div>
</div>

</body>
</html>