mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Fixed #26011 -- Prevented random LiveServerTestCase test failures on Windows.
Prevented LiveServerTestCase from stealing ports used by concurrent processes on Windows.
This commit is contained in:
committed by
Tim Graham
parent
89616f0c79
commit
c87540cee5
@@ -70,6 +70,7 @@ class WSGIServer(simple_server.WSGIServer, object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
if kwargs.pop('ipv6', False):
|
||||
self.address_family = socket.AF_INET6
|
||||
self.allow_reuse_address = kwargs.pop('allow_reuse_address', True)
|
||||
super(WSGIServer, self).__init__(*args, **kwargs)
|
||||
|
||||
def server_bind(self):
|
||||
|
||||
@@ -1252,7 +1252,7 @@ class LiveServerThread(threading.Thread):
|
||||
self.is_ready.set()
|
||||
|
||||
def _create_server(self, port):
|
||||
return WSGIServer((self.host, port), QuietWSGIRequestHandler)
|
||||
return WSGIServer((self.host, port), QuietWSGIRequestHandler, allow_reuse_address=False)
|
||||
|
||||
def terminate(self):
|
||||
if hasattr(self, 'httpd'):
|
||||
|
||||
Reference in New Issue
Block a user