[Zope-Checkins] CVS: ZODB3/ZODB/tests - PackableStorage.py:1.26
Tim Peters
tim.one at comcast.net
Fri Jan 9 15:06:15 EST 2004
Update of /cvs-repository/ZODB3/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv31961/ZODB/tests
Modified Files:
PackableStorage.py
Log Message:
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).
=== ZODB3/ZODB/tests/PackableStorage.py 1.25 => 1.26 ===
--- ZODB3/ZODB/tests/PackableStorage.py:1.25 Wed Dec 24 11:01:58 2003
+++ ZODB3/ZODB/tests/PackableStorage.py Fri Jan 9 15:06:15 2004
@@ -25,7 +25,6 @@
except ImportError:
from StringIO import StringIO
-import threading
import time
from ZODB import DB
@@ -35,6 +34,8 @@
from ZODB.tests.StorageTestBase import snooze
from ZODB.POSException import ConflictError
+from ZODB.tests.MTStorage import TestThread
+
ZERO = '\0'*8
@@ -505,14 +506,14 @@
# 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):
More information about the Zope-Checkins
mailing list