Commit b629361e authored by dpranke's avatar dpranke Committed by Commit bot

Don't log xvfb errors under normal circumstances in run-webkit-tests.

This CL hides a bunch of the debug logging we added for crbug.com/708681
so that we only get the info if something goes awry (and not all of the time).

R=tansell@chromium.org
BUG=708681

Review-Url: https://codereview.chromium.org/2846593004
Cr-Commit-Position: refs/heads/master@{#471184}
parent 410c20c0
...@@ -357,7 +357,8 @@ class Port(object): ...@@ -357,7 +357,8 @@ class Port(object):
def error_handler(script_error): def error_handler(script_error):
local_error.exit_code = script_error.exit_code local_error.exit_code = script_error.exit_code
_log.warn('DISPLAY = %s', self.host.environ.get('DISPLAY', '')) if self.host.platform.is_linux():
_log.debug('DISPLAY = %s', self.host.environ.get('DISPLAY', ''))
output = self._executive.run_command(cmd, error_handler=error_handler) output = self._executive.run_command(cmd, error_handler=error_handler)
if local_error.exit_code: if local_error.exit_code:
_log.error('System dependencies check failed.') _log.error('System dependencies check failed.')
......
...@@ -116,7 +116,7 @@ class LinuxPort(base.Port): ...@@ -116,7 +116,7 @@ class LinuxPort(base.Port):
def clean_up_test_run(self): def clean_up_test_run(self):
super(LinuxPort, self).clean_up_test_run() super(LinuxPort, self).clean_up_test_run()
self._stop_xvfb() self._stop_xvfb(save_logs=False)
self._clean_up_dummy_home_dir() self._clean_up_dummy_home_dir()
# #
...@@ -190,13 +190,13 @@ class LinuxPort(base.Port): ...@@ -190,13 +190,13 @@ class LinuxPort(base.Port):
exit_code = self.host.executive.run_command( exit_code = self.host.executive.run_command(
['xdpyinfo'], return_exit_code=True) ['xdpyinfo'], return_exit_code=True)
if exit_code == 0: if exit_code == 0:
_log.info('Successfully started Xvfb with display "%s".', display) _log.debug('Successfully started Xvfb with display "%s".', display)
return return
_log.warn('xdpyinfo check failed with exit code %s while starting Xvfb on "%s".', exit_code, display) _log.warn('xdpyinfo check failed with exit code %s while starting Xvfb on "%s".', exit_code, display)
self.host.sleep(0.1) self.host.sleep(0.1)
retcode = self._xvfb_process.poll() retcode = self._xvfb_process.poll()
self._stop_xvfb() self._stop_xvfb(save_logs=True)
_log.critical('Failed to start Xvfb on display "%s" (xvfb retcode: %r).', display, retcode) _log.critical('Failed to start Xvfb on display "%s" (xvfb retcode: %r).', display, retcode)
def _find_display(self): def _find_display(self):
...@@ -210,7 +210,7 @@ class LinuxPort(base.Port): ...@@ -210,7 +210,7 @@ class LinuxPort(base.Port):
return display return display
return None return None
def _stop_xvfb(self): def _stop_xvfb(self, save_logs):
if self._original_display: if self._original_display:
self.host.environ['DISPLAY'] = self._original_display self.host.environ['DISPLAY'] = self._original_display
if self._xvfb_stdout: if self._xvfb_stdout:
...@@ -221,11 +221,11 @@ class LinuxPort(base.Port): ...@@ -221,11 +221,11 @@ class LinuxPort(base.Port):
_log.debug('Killing Xvfb process pid %d.', self._xvfb_process.pid) _log.debug('Killing Xvfb process pid %d.', self._xvfb_process.pid)
self._xvfb_process.kill() self._xvfb_process.kill()
self._xvfb_process.wait() 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(): for line in self.host.filesystem.read_text_file(self._xvfb_stdout.name).splitlines():
_log.warn('Xvfb stdout: %s', line) _log.warn('Xvfb stdout: %s', line)
self.host.filesystem.remove(self._xvfb_stdout.name) 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(): for line in self.host.filesystem.read_text_file(self._xvfb_stderr.name).splitlines():
_log.warn('Xvfb stderr: %s', line) _log.warn('Xvfb stderr: %s', line)
self.host.filesystem.remove(self._xvfb_stderr.name) self.host.filesystem.remove(self._xvfb_stderr.name)
......
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