Changeset 88680 in webkit
- Timestamp:
- Jun 13, 2011 1:20:05 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r88679 r88680 1 2011-06-13 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r88671. 4 http://trac.webkit.org/changeset/88671 5 https://bugs.webkit.org/show_bug.cgi?id=62591 6 7 "didn't work" (Requested by dpranke on #webkit). 8 9 * Scripts/new-run-webkit-httpd: 10 * Scripts/webkitpy/layout_tests/port/apache_http_server.py: 11 * Scripts/webkitpy/layout_tests/port/http_server.py: 12 * Scripts/webkitpy/layout_tests/port/http_server_base.py: 13 * Scripts/webkitpy/layout_tests/port/http_server_integrationtest.py: Removed. 14 * Scripts/webkitpy/layout_tests/port/port_testcase.py: 15 * Scripts/webkitpy/layout_tests/port/websocket_server.py: 16 1 17 2011-06-13 Nate Chapin <japhet@chromium.org> 2 18 -
trunk/Tools/Scripts/new-run-webkit-httpd
r88671 r88680 71 71 httpd.start() 72 72 else: 73 # FIXME: We use _shut_down_http_server() instead of stop_http_server() 74 # because stop() only works if start() was called previously in the 75 # same process. _shut_down() is too coarse and may kill unrelated 76 # web servers, so this is a hack. We should change the interface so we 77 # can rely on pid files or something. 78 port_obj._shut_down_http_server(None) 73 httpd.stop(force=True) 74 79 75 80 76 def main(): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/apache_http_server.py
r88671 r88680 228 228 _log.debug("Shutting down any running http servers") 229 229 httpd_pid = None 230 if self._httpd_proc: 231 httpd_pid = self._httpd_proc.pid 232 elif os.path.exists(self._pid_file): 230 if os.path.exists(self._pid_file): 233 231 httpd_pid = int(open(self._pid_file).readline()) 234 if httpd_pid:235 self._executive.kill_process(httpd_pid)232 # FIXME: We shouldn't be calling a protected method of _port_obj! 233 self._port_obj._shut_down_http_server(httpd_pid) -
trunk/Tools/Scripts/webkitpy/layout_tests/port/http_server.py
r88671 r88680 227 227 # probably not being flushed, etc... why doesn't our python have os.kill ? 228 228 229 def stop(self ):230 if not self.is_running():229 def stop(self, force=False): 230 if not force and not self.is_running(): 231 231 return 232 232 … … 234 234 if self._process: 235 235 httpd_pid = self._process.pid 236 self._ executive.kill_process(httpd_pid)236 self._port_obj._shut_down_http_server(httpd_pid) 237 237 238 238 if self._process: -
trunk/Tools/Scripts/webkitpy/layout_tests/port/http_server_base.py
r88671 r88680 44 44 def __init__(self, port_obj): 45 45 self._port_obj = port_obj 46 self._executive = port_obj._executive47 46 48 47 def wait_for_action(self, action): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py
r88671 r88680 49 49 class PortTestCase(unittest.TestCase): 50 50 """Tests that all Port implementations must pass.""" 51 HTTP_PORTS = (8000, 8080, 8443) 52 WEBSOCKET_PORTS = (8880,) 51 52 HTTP_PORTS = [8000, 8080, 8443] 53 WEBSOCKET_PORTS = [8880] 53 54 54 55 def port_maker(self, platform): … … 92 93 for port in ports: 93 94 try: 94 test_socket= socket.socket()95 test_socket.connect((host, port))95 s = socket.socket() 96 s.connect((host, port)) 96 97 self.fail() 97 98 except IOError, e: 98 99 self.assertTrue(e.errno in (errno.ECONNREFUSED, errno.ECONNRESET)) 99 100 finally: 100 test_socket.close()101 s.close() 101 102 102 103 def assert_servers_are_up(self, host, ports): 103 104 for port in ports: 104 105 try: 105 test_socket= socket.socket()106 test_socket.connect((host, port))106 s = socket.socket() 107 s.connect((host, port)) 107 108 except IOError, e: 108 109 self.fail('failed to connect to %s:%d' % (host, port)) 109 110 finally: 110 test_socket.close()111 s.close() 111 112 112 113 def integration_test_http_lock(self): … … 137 138 if not port: 138 139 return 140 139 141 self.assert_servers_are_down('localhost', self.HTTP_PORTS) 140 142 port.start_http_server() … … 147 149 if not port: 148 150 return 151 149 152 # Test that if a port isn't available, the call fails. 150 153 for port_number in self.HTTP_PORTS: 151 test_socket= socket.socket()154 s = socket.socket() 152 155 try: 153 156 try: 154 test_socket.bind(('localhost', port_number))157 s.bind(('localhost', port_number)) 155 158 except socket.error, e: 156 159 if e.errno in (errno.EADDRINUSE, errno.EALREADY): … … 164 167 finally: 165 168 port.stop_http_server() 166 test_socket.close()169 s.close() 167 170 168 171 # Test that calling start() twice fails. … … 258 261 # Test that start() fails if a port isn't available. 259 262 for port_number in self.WEBSOCKET_PORTS: 260 test_socket= socket.socket()261 try: 262 test_socket.bind(('localhost', port_number))263 s = socket.socket() 264 try: 265 s.bind(('localhost', port_number)) 263 266 try: 264 267 port.start_websocket_server() … … 268 271 finally: 269 272 port.stop_websocket_server() 270 test_socket.close()273 s.close() 271 274 272 275 # Test that calling start() twice fails. -
trunk/Tools/Scripts/webkitpy/layout_tests/port/websocket_server.py
r88671 r88680 210 210 if not url_is_alive(url): 211 211 if self._process.returncode == None: 212 self._executive.kill_process(self._process.pid) 212 # FIXME: We should use a non-static Executive for easier 213 # testing. 214 Executive().kill_process(self._process.pid) 213 215 with codecs.open(output_log, "r", "utf-8") as fp: 214 216 for line in fp: … … 226 228 file.write("%d" % self._process.pid) 227 229 228 def stop(self ):229 if not self.is_running():230 def stop(self, force=False): 231 if not force and not self.is_running(): 230 232 return 231 233 … … 242 244 243 245 _log.debug('Shutting down %s server %d.' % (self._server_name, pid)) 244 self._executive.kill_process(pid) 246 # FIXME: We should use a non-static Executive for easier testing. 247 Executive().kill_process(pid) 245 248 246 249 if self._process:
Note: See TracChangeset
for help on using the changeset viewer.