Commit c883752e authored by Jeremy Hylton's avatar Jeremy Hylton

Extend tearDown to delete .zec.trace files if they happen to exist.

parent 95b4a6bc
...@@ -109,22 +109,23 @@ class CommonSetupTearDown(StorageTestBase): ...@@ -109,22 +109,23 @@ class CommonSetupTearDown(StorageTestBase):
os.waitpid(pid, 0) os.waitpid(pid, 0)
for c in self.caches: for c in self.caches:
for i in 0, 1: for i in 0, 1:
path = "%s-%s.zec" % (c, "1") for ext in "", ".trace":
path = "%s-%s.zec%s" % (c, "1", ext)
# On Windows before 2.3, we don't have a way to wait for # On Windows before 2.3, we don't have a way to wait for
# the spawned server(s) to close, and they inherited # the spawned server(s) to close, and they inherited
# file descriptors for our open files. So long as those # file descriptors for our open files. So long as those
# processes are alive, we can't delete the files. Try # processes are alive, we can't delete the files. Try
# a few times then give up. # a few times then give up.
need_to_delete = 0 need_to_delete = False
if os.path.exists(path): if os.path.exists(path):
need_to_delete = 1 need_to_delete = True
for dummy in range(5): for dummy in range(5):
try: try:
os.unlink(path) os.unlink(path)
except: except:
time.sleep(0.5) time.sleep(0.5)
else: else:
need_to_delete = 0 need_to_delete = False
break break
if need_to_delete: if need_to_delete:
os.unlink(path) # sometimes this is just gonna fail os.unlink(path) # sometimes this is just gonna fail
...@@ -576,6 +577,7 @@ class InvqTests(CommonSetupTearDown): ...@@ -576,6 +577,7 @@ class InvqTests(CommonSetupTearDown):
self._storage = self.openClientStorage() self._storage = self.openClientStorage()
oid = self._storage.new_oid() oid = self._storage.new_oid()
oid2 = self._storage.new_oid()
# When we create a new storage, it should always do a full # When we create a new storage, it should always do a full
# verification # verification
self.assertEqual(self._storage.verify_result, "full verification") self.assertEqual(self._storage.verify_result, "full verification")
...@@ -583,6 +585,7 @@ class InvqTests(CommonSetupTearDown): ...@@ -583,6 +585,7 @@ class InvqTests(CommonSetupTearDown):
# message is generated # message is generated
revid = self._dostore(oid) revid = self._dostore(oid)
revid = self._dostore(oid, revid) revid = self._dostore(oid, revid)
self._dostore(oid2)
# sync() is needed to prevent invalidation for oid from arriving # sync() is needed to prevent invalidation for oid from arriving
# in the middle of the load() call. # in the middle of the load() call.
......
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