Commit e0300a10 authored by Guido van Rossum's avatar Guido van Rossum

Change the random port generator to only generate even port numbers.

On Windows, port+1 is used as well, so we don't want accidentally to
allocate two adjacent ports when we ask for multiple ports.
parent 5aa4c348
......@@ -233,7 +233,9 @@ class ConnectionTests(StorageTestBase.StorageTestBase):
self.addr.append(self._getAddr())
def _getAddr(self):
return 'localhost', random.randrange(25000, 30000)
# On windows, port+1 is also used (see winserver.py), so only
# draw even port numbers
return 'localhost', random.randrange(25000, 30000, 2)
def openClientStorage(self, cache='', cache_size=200000, wait=1,
read_only=0, read_only_fallback=0):
......
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