Commit 4a6f51c1 authored by Tim Peters's avatar Tim Peters

New (but disabled for now) test checkPackLotsWhileWriting reliably dies

with

    CorruptedError:  ... transaction with checkpoint flag set

on my box when doing the ZEO flavor of FileStorage.  This is like the
other pack-while-writing tests, but uses only 1 client thread that does
twice as much, and packs repeatedly for so long as that thread runs.  I
usually see it fail before the fourth pack attempt.
parent 8ce72435
...@@ -248,11 +248,11 @@ class PackableStorage(PackableStorageBase): ...@@ -248,11 +248,11 @@ class PackableStorage(PackableStorageBase):
if not hasattr(self._storage, "iterator"): if not hasattr(self._storage, "iterator"):
return return
iter = self._storage.iterator() it = self._storage.iterator()
for txn in iter: for txn in it:
for data in txn: for data in txn:
pass pass
iter.close() it.close()
def checkPackWhileWriting(self): def checkPackWhileWriting(self):
self._PackWhileWriting(pack_now=False) self._PackWhileWriting(pack_now=False)
...@@ -260,6 +260,55 @@ class PackableStorage(PackableStorageBase): ...@@ -260,6 +260,55 @@ class PackableStorage(PackableStorageBase):
def checkPackNowWhileWriting(self): def checkPackNowWhileWriting(self):
self._PackWhileWriting(pack_now=True) self._PackWhileWriting(pack_now=True)
# XXX Disabled because it always fails now.
def XXXcheckPackLotsWhileWriting(self):
# This is like the other pack-while-writing tests, except it packs
# repeatedly until the client thread is done. At the time it was
# introduced, it reliably provoked
# CorruptedError: ... transaction with checkpoint flag set
# in the ZEO flavor of the FileStorage tests.
db = DB(self._storage)
conn = db.open()
root = conn.root()
choices = range(10)
for i in choices:
root[i] = MinPO(i)
get_transaction().commit()
snooze()
packt = time.time()
for dummy in choices:
for i in choices:
root[i].value = MinPO(i)
get_transaction().commit()
NUM_LOOP_TRIP = 100
timer = ElapsedTimer(time.time())
threads = [ClientThread(db, choices, NUM_LOOP_TRIP, timer, i)
for i in range(1)]
for t in threads:
t.start()
while True in [t.isAlive() for t in threads]:
db.pack(packt)
snooze()
packt = time.time()
for t in threads:
t.join()
# Iterate over the storage to make sure it's sane.
if not hasattr(self._storage, "iterator"):
return
it = self._storage.iterator()
for txn in it:
for data in txn:
pass
it.close()
class PackableUndoStorage(PackableStorageBase): class PackableUndoStorage(PackableStorageBase):
def checkPackAllRevisions(self): def checkPackAllRevisions(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