﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21227	Selenium tests terminate with [Errno 10054]	Kevin Christopher Henry	nobody	"When I run the test suite on Windows with the `--selenium` option, I consistently see errors like this:

{{{
Exception happened during processing of request from ('127.0.0.1', 51603)
Traceback (most recent call last):
  File ""C:\Program Other\Python27\Lib\SocketServer.py"", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File ""C:\Program Other\Python27\Lib\SocketServer.py"", line 321, in process_request
    self.finish_request(request, client_address)
  File ""C:\Program Other\Python27\Lib\SocketServer.py"", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File ""C:\Django\django\django\core\servers\basehttp.py"", line 126, in __init__
    super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File ""C:\Program Other\Python27\Lib\SocketServer.py"", line 649, in __init__
    self.handle()
  File ""C:\Program Other\Python27\Lib\wsgiref\simple_server.py"", line 116, in handle
    self.raw_requestline = self.rfile.readline()
  File ""C:\Program Other\Python27\Lib\socket.py"", line 447, in readline
    data = self._sock.recv(self._rbufsize)
error: [Errno 10054] An existing connection was forcibly closed by the remote host
}}}

Based on some [http://stackoverflow.com/questions/15244153/whats-the-proper-way-to-close-a-socket-avoid-errno-10054-with-python-django anecdotal] [http://stackoverflow.com/questions/13243267/django-and-selenium-web-testing-error-errno-10054 data], I tried putting a `refresh()` before the `quit()` in `contrib.admin.tests.AdminSeleniumWebDriverTestCase._tearDownClassInternal()` and that reliably solved the problem.

I have no idea why this works, but if it does it's probably worth doing since it should be harmless.
"	Bug	closed	Testing framework	dev	Normal	fixed	selenium	Florian Apolloner	Accepted	0	0	0	0	0	0
