[Zope3-checkins] CVS: ZODB/src/ZODB/tests - PackableStorage.py:1.34
Tim Peters
tim.one at comcast.net
Fri Mar 12 14:41:51 EST 2004
Update of /cvs-repository/ZODB/src/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv11782/src/ZODB/tests
Modified Files:
PackableStorage.py
Log Message:
_PackWhileWriting: Cut the number of threads and boost the max timeout.
This makes the ZEO flavors of the tests much more likely to complete
without a "thread still alive" failure.
=== ZODB/src/ZODB/tests/PackableStorage.py 1.33 => 1.34 ===
--- ZODB/src/ZODB/tests/PackableStorage.py:1.33 Fri Mar 12 13:08:13 2004
+++ ZODB/src/ZODB/tests/PackableStorage.py Fri Mar 12 14:41:50 2004
@@ -175,10 +175,20 @@
root[i].value = MinPO(i)
get_transaction().commit()
+ # How many client threads should we run, and how long should we
+ # wait for them to finish? Hard to say. Running 4 threads and
+ # waiting 30 seconds too often left a thread still alive on Tim's
+ # Win98SE box, during ZEO flavors of this test. Those tend to
+ # run one thread at a time to completion, and take about 10 seconds
+ # per thread. There doesn't appear to be a compelling reason to
+ # run that many threads. Running 3 threads and waiting up to a
+ # minute seems to work well in practice. The ZEO tests normally
+ # finish faster than that, and the non-ZEO tests very much faster
+ # than that.
NUM_LOOP_TRIP = 50
timer = ElapsedTimer(time.time())
threads = [ClientThread(db, choices, NUM_LOOP_TRIP, timer, i)
- for i in range(4)]
+ for i in range(3)]
for t in threads:
t.start()
@@ -188,7 +198,7 @@
db.pack(packt)
for t in threads:
- t.join(30)
+ t.join(60)
liveness = [t.isAlive() for t in threads]
if True in liveness:
# They should have finished by now.
More information about the Zope3-Checkins
mailing list