[Zodb-checkins] CVS: Packages/ZEO - testZEO.py:1.7

jeremy@digicool.com jeremy@digicool.com
Tue, 22 May 2001 14:15:56 -0400 (EDT)


Update of /cvs-repository/Packages/ZEO/tests
In directory korak.digicool.com:/tmp/cvs-serv7627

Modified Files:
	testZEO.py 
Log Message:
tearDown(): Call delStorage() to clean up.



--- Updated File testZEO.py in package Packages/ZEO --
--- testZEO.py	2001/05/09 18:58:00	1.6
+++ testZEO.py	2001/05/22 18:15:56	1.7
@@ -3,6 +3,7 @@
 import asyncore
 import os
 import random
+import sys
 import tempfile
 import time
 import types
@@ -139,6 +140,7 @@
         self.running = 0
         self._server.close()
         os.waitpid(self._pid, 0)
+        self.delStorage()
         self.__super_tearDown()
 
     def checkLargeUpdate(self):
@@ -165,6 +167,9 @@
     __super_setUp = StorageTestBase.StorageTestBase.setUp
     __super_tearDown = StorageTestBase.StorageTestBase.tearDown
 
+    ports = range(29000, 30000, 10) # enough for 100 tests
+    random.shuffle(ports)
+
     def setUp(self):
         """Start a ZEO server using a Unix domain socket
 
@@ -174,7 +179,7 @@
         self.running = 1
         self.__fs_base = tempfile.mktemp()
         fs = FileStorage(self.__fs_base, create=1)
-        self.addr = '', random.randrange(2000, 3000)
+        self.addr = '', self.ports.pop()
         pid, exit = forker.start_zeo_server(fs, self.addr)
         self._pid = pid
         self._server = exit