Commit 4710a5c4 authored by Tim Peters's avatar Tim Peters

ClientThread(): Some of the packing tests still fail in rare & strange

ways, but unittest never notices this because the tests always fail in
a thread unittest doesn't know anything about.  Changed ClientThread
to derive from the MTStorage tests' TestThread, which arranges to re-raise
a thread-death exception in the main thread.  Tested "by hand", via
temporarily forcing fatal thread exceptions in all the Pack[Now]WhileWriting
tests; unittest did notice those now.  So, when this happens again in real
life, we'll no longer be fooled by test runner reports claiming that
everything passed, and then frustrated by not even being able to tell
which test failed (you can't tell from the isolated thread traceback(s)
wading in the sea of testrunner dot output).
parent adf443be
......@@ -25,7 +25,6 @@ try:
except ImportError:
from StringIO import StringIO
import threading
import time
from ZODB import DB
......@@ -35,6 +34,8 @@ from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase import snooze
from ZODB.POSException import ConflictError
from ZODB.tests.MTStorage import TestThread
ZERO = '\0'*8
......@@ -505,14 +506,14 @@ class PackableUndoStorage(PackableStorageBase):
# what can we assert about that?
class ClientThread(threading.Thread):
class ClientThread(TestThread):
def __init__(self, db, choices):
threading.Thread.__init__(self)
TestThread.__init__(self)
self.root = db.open().root()
self.choices = choices
def run(self):
def runtest(self):
from random import choice
for j in range(50):
......
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