Commit a5649f69 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 754c3f5a
......@@ -27,11 +27,12 @@ def main():
tdb = TestDB_ZEO('<zeo>')
#tdb = TestDB_NEO('<neo>')
defer(tdb.teardown)
tdb.setup()
# XXX defer(tdb.teardown)
# two ZODB client storage connections to the same server
zstor1 = tdb.getZODBStorage() ; defer(zstor1.close)
zstor2 = tdb.getZODBStorage() ; defer(zstor2.close)
zstor1 = tdb.getZODBStorage() # ; defer(zstor1.close)
zstor2 = tdb.getZODBStorage() # ; defer(zstor2.close)
db1 = DB(zstor1)
db2 = DB(zstor2)
......
......@@ -110,33 +110,14 @@ class PInt(Persistent):
def main():
# for ZODB5: open vs invalidation race
if 0:
zstor1 = zstor2 = MappingStorage()
db1 = db2 = DB(zstor1)
# for ZODB3/ZODB5: load vs invalidation race
if 1:
from wendelin.lib.testing import TestDB_ZEO, TestDB_NEO
tdb = TestDB_ZEO('<zeo>')
#tdb = TestDB_NEO('<neo>')
tdb.setup()
# XXX defer(tdb.teardown)
# two ZODB client storage connections to the same server
zstor1 = tdb.getZODBStorage() # ; defer(zstor1.close)
zstor2 = tdb.getZODBStorage() # ; defer(zstor2.close)
db1 = DB(zstor1)
db2 = DB(zstor2)
zstor = MappingStorage()
db = DB(zstor)
# init initializes the database with two integer objects - obj1/obj2 that are set to 0.
def init():
transaction.begin()
zconn = db1.open()
zconn = db.open()
root = zconn.root()
root['obj1'] = PInt(0)
......@@ -155,7 +136,7 @@ def main():
def T1(N):
def t1():
transaction.begin()
zconn = db1.open()
zconn = db.open()
root = zconn.root()
obj1 = root['obj1']
......@@ -175,10 +156,8 @@ def main():
zconn.close()
for i in range(N):
print('T1.%d' % i)
#print('T1.%d' % i)
t1()
#import time
#time.sleep(1)
okv[0] = True
......@@ -188,7 +167,7 @@ def main():
def T2(N):
def t2():
transaction.begin()
zconn = db2.open()
zconn = db.open()
root = zconn.root()
obj1 = root['obj1']
......@@ -201,7 +180,7 @@ def main():
zconn.close()
for i in range(N):
print('T2.%d' % i)
#print('T2.%d' % i)
t2()
okv[1] = True
......
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