[Zodb-checkins] CVS: ZODB3/ZEO/tests - testZEO.py:1.46
Guido van Rossum
guido@python.org
Thu, 19 Sep 2002 15:55:22 -0400
Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv32730
Modified Files:
testZEO.py
Log Message:
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.
=== ZODB3/ZEO/tests/testZEO.py 1.45 => 1.46 ===
--- ZODB3/ZEO/tests/testZEO.py:1.45 Tue Sep 17 13:58:19 2002
+++ ZODB3/ZEO/tests/testZEO.py Thu Sep 19 15:55:22 2002
@@ -233,7 +233,9 @@
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):