Commit 6665dd6a authored by Jeremy Hylton's avatar Jeremy Hylton

tearDown(): Call delStorage() to clean up.

parent e56f46e7
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
import asyncore import asyncore
import os import os
import random import random
import sys
import tempfile import tempfile
import time import time
import types import types
...@@ -139,6 +140,7 @@ class GenericTests(ZEOTestBase, ...@@ -139,6 +140,7 @@ class GenericTests(ZEOTestBase,
self.running = 0 self.running = 0
self._server.close() self._server.close()
os.waitpid(self._pid, 0) os.waitpid(self._pid, 0)
self.delStorage()
self.__super_tearDown() self.__super_tearDown()
def checkLargeUpdate(self): def checkLargeUpdate(self):
...@@ -165,6 +167,9 @@ class PersistentCacheTests(ZEOTestBase): ...@@ -165,6 +167,9 @@ class PersistentCacheTests(ZEOTestBase):
__super_setUp = StorageTestBase.StorageTestBase.setUp __super_setUp = StorageTestBase.StorageTestBase.setUp
__super_tearDown = StorageTestBase.StorageTestBase.tearDown __super_tearDown = StorageTestBase.StorageTestBase.tearDown
ports = range(29000, 30000, 10) # enough for 100 tests
random.shuffle(ports)
def setUp(self): def setUp(self):
"""Start a ZEO server using a Unix domain socket """Start a ZEO server using a Unix domain socket
...@@ -174,7 +179,7 @@ class PersistentCacheTests(ZEOTestBase): ...@@ -174,7 +179,7 @@ class PersistentCacheTests(ZEOTestBase):
self.running = 1 self.running = 1
self.__fs_base = tempfile.mktemp() self.__fs_base = tempfile.mktemp()
fs = FileStorage(self.__fs_base, create=1) 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) pid, exit = forker.start_zeo_server(fs, self.addr)
self._pid = pid self._pid = pid
self._server = exit self._server = exit
......
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