[Zodb-checkins] CVS: ZODB3/ZEO/tests - InvalidationTests.py:1.9
Jeremy Hylton
jeremy at zope.com
Tue Jan 6 16:45:12 EST 2004
Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv1556/ZEO/tests
Modified Files:
InvalidationTests.py
Log Message:
Make sure both databases are up to date before checking trees for
missing keys.
=== ZODB3/ZEO/tests/InvalidationTests.py 1.8 => 1.9 ===
--- ZODB3/ZEO/tests/InvalidationTests.py:1.8 Tue Jan 6 10:57:42 2004
+++ ZODB3/ZEO/tests/InvalidationTests.py Tue Jan 6 16:45:11 2004
@@ -452,6 +452,7 @@
cn = db1.open()
tree = cn.root()["tree"] = OOBTree()
get_transaction().commit()
+ cn.close()
# Run two threads that update the BTree
cd = {}
@@ -459,7 +460,11 @@
t2 = self.StressThread(self, db2, stop, 2, cd, 2)
self.go(stop, cd, t1, t2)
- cn.sync()
+ while db1.lastTransaction() != db2.lastTransaction():
+ db1._storage.sync()
+ db2._storage.sync()
+
+ cn = db1.open()
self._check_tree(cn, tree)
self._check_threads(tree, t1, t2)
@@ -475,6 +480,7 @@
cn = db1.open()
tree = cn.root()["tree"] = OOBTree()
get_transaction().commit()
+ cn.close()
# Run two threads that update the BTree
cd = {}
@@ -482,7 +488,7 @@
t2 = self.StressThread(self, db1, stop, 2, cd, 2, sleep=0.01)
self.go(stop, cd, t1, t2)
- cn.sync()
+ cn = db1.open()
self._check_tree(cn, tree)
self._check_threads(tree, t1, t2)
@@ -498,6 +504,7 @@
cn = db1.open()
tree = cn.root()["tree"] = OOBTree()
get_transaction().commit()
+ cn.close()
# Run three threads that update the BTree.
# Two of the threads share a single storage so that it
@@ -510,7 +517,11 @@
t3 = self.StressThread(self, db2, stop, 3, cd, 3, 3, 0.01)
self.go(stop, cd, t1, t2, t3)
- cn.sync()
+ while db1.lastTransaction() != db2.lastTransaction():
+ db1._storage.sync()
+ db2._storage.sync()
+
+ cn = db1.open()
self._check_tree(cn, tree)
self._check_threads(tree, t1, t2, t3)
@@ -527,6 +538,7 @@
cn = db1.open()
tree = cn.root()["tree"] = OOBTree()
get_transaction().commit()
+ cn.close()
# Run three threads that update the BTree.
# Two of the threads share a single storage so that it
@@ -537,10 +549,13 @@
t1 = VersionStressThread(self, db1, stop, 1, cd, 1, 3)
t2 = VersionStressThread(self, db2, stop, 2, cd, 2, 3, 0.01)
t3 = VersionStressThread(self, db2, stop, 3, cd, 3, 3, 0.01)
-## t1 = VersionStressThread(self, db2, stop, 3, cd, 1, 3, 0.01)
self.go(stop, cd, t1, t2, t3)
- cn.sync()
+ while db1.lastTransaction() != db2.lastTransaction():
+ db1._storage.sync()
+ db2._storage.sync()
+
+ cn = db1.open()
self._check_tree(cn, tree)
self._check_threads(tree, t1, t2, t3)
@@ -560,6 +575,7 @@
for i in range(0, 3000, 2):
tree[i] = 0
get_transaction().commit()
+ cn.close()
# Run three threads that update the BTree.
# Two of the threads share a single storage so that it
@@ -572,7 +588,10 @@
t3 = LargeUpdatesThread(self, db2, stop, 3, cd, 3, 3, 0.01)
self.go(stop, cd, t1, t2, t3)
- cn.sync()
+ while db1.lastTransaction() != db2.lastTransaction():
+ db1._storage.sync()
+ db2._storage.sync()
+ cn = db1.open()
self._check_tree(cn, tree)
# Purge the tree of the dummy entries mapping to 0.
More information about the Zodb-checkins
mailing list