Commit 8f30384b authored by jsbell@chromium.org's avatar jsbell@chromium.org

Set SO_REUSEADDR on layout test server sockets on non-Windows systems

Code to set the flag was removed as part of debugging crbug.com/378444
but this causes ports to report as "in use" for some time after the
test server stops, meaning that re-running layout tests with only a
short delay may fail.

Restore setting the flag, but scoped to non-Windows systems.

BUG=378444
R=dpranke@chromium.org

Review URL: https://codereview.chromium.org/464543003

git-svn-id: svn://svn.chromium.org/blink/trunk@180001 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent ea72145c
......@@ -261,7 +261,8 @@ class ServerBase(object):
def _check_that_all_ports_are_available(self):
for mapping in self._mappings:
s = socket.socket()
# s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
if not self._platform.is_win():
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
port = mapping['port']
try:
s.bind(('localhost', port))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment