diff options
author | dpranke@google.com <dpranke@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-29 03:51:29 +0000 |
---|---|---|
committer | dpranke@google.com <dpranke@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-29 03:51:29 +0000 |
commit | acf0a90181626aa23b7649c07e5be02b848d3e69 (patch) | |
tree | 21bb946e620773f0907fa3055c47e16ca7c24f1b | |
parent | eee9f55299e1223c156f1bcf86f557446009cc5e (diff) | |
download | chromium_src-acf0a90181626aa23b7649c07e5be02b848d3e69.zip chromium_src-acf0a90181626aa23b7649c07e5be02b848d3e69.tar.gz chromium_src-acf0a90181626aa23b7649c07e5be02b848d3e69.tar.bz2 |
Modify the websocket server code to log to the results dir rather than stdout/
stderr. This is a re-submit of an earlier checkin that we reverted (r32911),
but fixes the problem where we tried to delete open files, and also doesn't
double-write the error log.
BUG=none
R=ukai@chromium.org
TEST=none
Review URL: http://codereview.chromium.org/444019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33244 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/tools/layout_tests/layout_package/websocket_server.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/webkit/tools/layout_tests/layout_package/websocket_server.py b/webkit/tools/layout_tests/layout_package/websocket_server.py index 3d743c1..cbf7aca 100644 --- a/webkit/tools/layout_tests/layout_package/websocket_server.py +++ b/webkit/tools/layout_tests/layout_package/websocket_server.py @@ -86,12 +86,16 @@ class PyWebSocket(http_server.Lighttpd): log_prefix = _WSS_LOG_PREFIX else: log_prefix = _WS_LOG_PREFIX - log_file_name = log_prefix + time_str + '.txt' - error_log = os.path.join(self._output_dir, log_file_name) + log_file_name = log_prefix + time_str # Remove old log files. We only need to keep the last ones. RemoveLogFiles(self._output_dir, log_prefix) + error_log = os.path.join(self._output_dir, log_file_name + "-err.txt") + + output_log = os.path.join(self._output_dir, log_file_name + "-out.txt") + self._wsout = open(output_log, "w") + python_interp = sys.executable pywebsocket_base = path_utils.PathFromBase( 'third_party', 'WebKit', 'WebKitTools', 'pywebsocket') @@ -125,7 +129,8 @@ class PyWebSocket(http_server.Lighttpd): env.get('PYTHONPATH', '')) logging.debug('Starting %s server.' % self._server_name) - self._process = subprocess.Popen(start_cmd, env=env) + self._process = subprocess.Popen(start_cmd, stdout=self._wsout, + env=env) # Wait a bit before checking the liveness of the server. time.sleep(0.5) @@ -155,6 +160,9 @@ class PyWebSocket(http_server.Lighttpd): # Wait a bit to make sure the ports are free'd up time.sleep(2) + if self._wsout: + self._wsout.close() + self._wsout = None if '__main__' == __name__: |