[Zope-Checkins] CVS: Zope/lib/python/Products/CoreSessionTracking/othertests - testConflicts.py:1.1.2.1
Matthew T. Kromer
matt@zope.com
Thu, 4 Oct 2001 15:34:29 -0400
Update of /cvs-repository/Zope/lib/python/Products/CoreSessionTracking/othertests
In directory cvs.zope.org:/tmp/cvs-serv7585/othertests
Added Files:
Tag: matt-CoreSessionTracking-branch
testConflicts.py
Log Message:
Adding more files from CoreSessionTracking
=== Added File Zope/lib/python/Products/CoreSessionTracking/othertests/testConflicts.py ===
import os, sys, time, whrandom
sys.path.insert(0, '../../..')
os.chdir('../../..')
import Zope
app = Zope.app()
conflicts = Zope.conflicts
from threading import Thread, activeCount
class Worker(Thread):
def run(self):
Zope.debug('/testmethod')
time.sleep(.001 * whrandom.choice(range(0,5)))
for x in range(200):
nthreads = 5
for i in range(nthreads):
w = Worker()
w.start()
while activeCount() != 1:
pass
print "--- Conflicts: %s ---" % len(conflicts)