Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(801)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py

Issue 2837773002: webkitpy: Check xvfb with xdpyinfo after starting. (Closed)
Patch Set: Fixing tests Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py
index 9147c2ccdadea819aa98528973f160c6b854e8cd..758f59f96cbaa7eb3a3d1ecc1d5fc491e4b2f324 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py
@@ -48,6 +48,8 @@ class LinuxPort(base.Port):
BUILD_REQUIREMENTS_URL = 'https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md'
+ XVFB_START_TIMEOUT = 5.0 # Wait up to 5 seconds for Xvfb to start.
+
@classmethod
def determine_full_port_name(cls, host, options, port_name):
if port_name.endswith('linux'):
@@ -168,6 +170,19 @@ class LinuxPort(base.Port):
if self._xvfb_process.poll() is not None:
_log.warn('Failed to start Xvfb on display "%s."', display)
+ start_time = self.host.time()
+ while self.host.time() - start_time < self.XVFB_START_TIMEOUT:
+ # We don't explicitly set the display, as we want to check the
+ # environment value.
+ exit_code = self.host.executive.run_command(
+ ['xdpyinfo'], return_exit_code=True)
+ if exit_code == 0:
+ _log.info('Successfully started Xvfb with display "%s".', display)
+ return
+ _log.warn('xdpyinfo check failed with exit code %s while starting Xvfb on "%s".', exit_code, display)
+ self.host.sleep(0.1)
+ _log.fatal('Failed to start Xvfb on display "%s" (xdpyinfo check failed).', display)
+
def _find_display(self):
"""Tries to find a free X display, looping if necessary."""
# The "xvfb-run" command uses :99 by default.
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698