Commit 28806a6d authored by Jeremy Hylton's avatar Jeremy Hylton

Force test to fail if FileStorage doesn't raise StorageError

for a redundant pack.
parent 3356f09a
...@@ -34,6 +34,7 @@ from ZODB.referencesf import referencesf ...@@ -34,6 +34,7 @@ from ZODB.referencesf import referencesf
from ZODB.tests.MinPO import MinPO from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase import snooze from ZODB.tests.StorageTestBase import snooze
from ZODB.POSException import ConflictError, StorageError from ZODB.POSException import ConflictError, StorageError
from ZODB.FileStorage import FileStorage
from ZODB.tests.MTStorage import TestThread from ZODB.tests.MTStorage import TestThread
...@@ -473,13 +474,12 @@ class PackableUndoStorage(PackableStorageBase): ...@@ -473,13 +474,12 @@ class PackableUndoStorage(PackableStorageBase):
packt2 = time.time() packt2 = time.time()
db.pack(packt2) db.pack(packt2)
# BDBStorage allows the second pack, but doesn't lose data. if isinstance(self._storage, FileStorage):
try: # If FileStorage performed a redundant pack, it would
# remove the lost_oid.
self.assertRaises(StorageError, db.pack, packt1)
else:
db.pack(packt1) db.pack(packt1)
except StorageError:
pass
# This object would be removed by the second pack, even though
# it is reachable.
self._storage.load(lost_oid, "") self._storage.load(lost_oid, "")
def checkPackUndoLog(self): def checkPackUndoLog(self):
......
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