2010-06-03 Fumitoshi Ukai <ukai@chromium.org>
authorukai@chromium.org <ukai@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jun 2010 05:14:58 +0000 (05:14 +0000)
committerukai@chromium.org <ukai@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jun 2010 05:14:58 +0000 (05:14 +0000)
        Reviewed by David Levin.

        bad codecs.open in webkitpy/layout_tests/ports/websocket_server.py
        https://bugs.webkit.org/show_bug.cgi?id=40105

        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
        - kill pywebsocket process when url is not alive and the process is not
          terminated, not to leave pywebsocket server running.
        - fix codecs.open parameters.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@60654 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py

index c97bdf7..dba03bb 100644 (file)
@@ -1,5 +1,17 @@
 2010-06-03  Fumitoshi Ukai  <ukai@chromium.org>
 
+        Reviewed by David Levin.
+
+        bad codecs.open in webkitpy/layout_tests/ports/websocket_server.py
+        https://bugs.webkit.org/show_bug.cgi?id=40105
+
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+        - kill pywebsocket process when url is not alive and the process is not
+          terminated, not to leave pywebsocket server running.
+        - fix codecs.open parameters.
+
+2010-06-03  Fumitoshi Ukai  <ukai@chromium.org>
+
         Reviewed by Alexey Proskuryakov.
 
         old-run-webkit-tests should use ensure-valid-python to check if it can run the websockets tests
index 22ae780..81bf39e 100644 (file)
@@ -207,12 +207,13 @@ class PyWebSocket(http_server.Lighttpd):
             url = 'http'
         url = url + '://127.0.0.1:%d/' % self._port
         if not url_is_alive(url):
-            fp = codecs.open(output_log, "utf-8")
-            try:
+            if self._process.returncode == None:
+                # FIXME: We should use a non-static Executive for easier
+                # testing.
+                Executive().kill_process(self._process.pid)
+            with codecs.open(output_log, "r", "utf-8") as fp:
                 for line in fp:
                     _log.error(line)
-            finally:
-                fp.close()
             raise PyWebSocketNotStarted(
                 'Failed to start %s server on port %s.' %
                     (self._server_name, self._port))