Chromium Code Reviews| 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 d0c6bbd325e86c278c582898714ffe473bc9d302..425ae9d97696925264857adbea8c90f79d562352 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 |
| @@ -116,7 +116,7 @@ class LinuxPort(base.Port): |
| def clean_up_test_run(self): |
| super(LinuxPort, self).clean_up_test_run() |
| - self._stop_xvfb() |
| + self._stop_xvfb(save_logs=False) |
| self._clean_up_dummy_home_dir() |
| # |
| @@ -157,7 +157,7 @@ class LinuxPort(base.Port): |
| _log.warn('Failed to find a free display to start Xvfb.') |
| return |
| - _log.info('Starting Xvfb with display "%s".', display) |
| + _log.debug('Starting Xvfb with display "%s".', display) |
| self._xvfb_stdout = tempfile.NamedTemporaryFile(delete=False) |
| self._xvfb_stderr = tempfile.NamedTemporaryFile(delete=False) |
| self._xvfb_process = self.host.executive.popen( |
| @@ -174,7 +174,7 @@ class LinuxPort(base.Port): |
| # https://docs.python.org/2/library/subprocess.html#subprocess.Popen.poll |
| if self._xvfb_process.poll() is not None: |
| _log.warn('Failed to start Xvfb on display "%s."', display) |
| - self._stop_xvfb() |
| + self._stop_xvfb(save_logs=True) |
| start_time = self.host.time() |
| while self.host.time() - start_time < self.XVFB_START_TIMEOUT: |
|
mithro
2017/04/27 03:34:51
BTW - We should probably be checking self._xvfb_pr
Dirk Pranke
2017/04/27 17:18:31
Sure.
|
| @@ -183,12 +183,12 @@ class LinuxPort(base.Port): |
| 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) |
| + _log.debug('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) |
| - self._stop_xvfb() |
| + self._stop_xvfb(save_logs=True) |
| def _find_display(self): |
| """Tries to find a free X display, looping if necessary.""" |
| @@ -201,7 +201,7 @@ class LinuxPort(base.Port): |
| return display |
| return None |
| - def _stop_xvfb(self): |
| + def _stop_xvfb(self, save_logs): |
| if self._original_display: |
| self.host.environ['DISPLAY'] = self._original_display |
| if self._xvfb_stdout: |
| @@ -212,11 +212,11 @@ class LinuxPort(base.Port): |
| _log.debug('Killing Xvfb process pid %d.', self._xvfb_process.pid) |
| self._xvfb_process.kill() |
| self._xvfb_process.wait() |
| - if self._xvfb_stdout and self.host.filesystem.exists(self._xvfb_stdout.name): |
| + if save_logs and self._xvfb_stdout and self.host.filesystem.exists(self._xvfb_stdout.name): |
| for line in self.host.filesystem.read_text_file(self._xvfb_stdout.name).splitlines(): |
| _log.warn('Xvfb stdout: %s', line) |
| self.host.filesystem.remove(self._xvfb_stdout.name) |
| - if self._xvfb_stderr and self.host.filesystem.exists(self._xvfb_stderr.name): |
| + if save_logs and self._xvfb_stderr and self.host.filesystem.exists(self._xvfb_stderr.name): |
| for line in self.host.filesystem.read_text_file(self._xvfb_stderr.name).splitlines(): |
| _log.warn('Xvfb stderr: %s', line) |
| self.host.filesystem.remove(self._xvfb_stderr.name) |