Commit 09a987c1 authored by Jim Fulton's avatar Jim Fulton

Updated a test to make it a little less prone to spurious failures.

parent 8219e72c
...@@ -592,7 +592,7 @@ class InvqTests(CommonSetupTearDown): ...@@ -592,7 +592,7 @@ class InvqTests(CommonSetupTearDown):
invq = 3 invq = 3
def checkQuickVerificationWith2Clients(self): def checkQuickVerificationWith2Clients(self):
perstorage = self.openClientStorage(cache="test") perstorage = self.openClientStorage(cache="test", cache_size=4000)
self.assertEqual(perstorage.verify_result, "empty cache") self.assertEqual(perstorage.verify_result, "empty cache")
self._storage = self.openClientStorage() self._storage = self.openClientStorage()
...@@ -610,14 +610,19 @@ class InvqTests(CommonSetupTearDown): ...@@ -610,14 +610,19 @@ class InvqTests(CommonSetupTearDown):
revid2 = self._dostore(oid2) revid2 = self._dostore(oid2)
revid2 = self._dostore(oid2, revid2) revid2 = self._dostore(oid2, revid2)
# sync() is needed to prevent invalidation for oid from arriving
# in the middle of the load() call.
perstorage.sync()
perstorage.load(oid, '') perstorage.load(oid, '')
perstorage.close() perstorage.close()
forker.wait_until(lambda : os.path.exists('test-1.zec'))
revid = self._dostore(oid, revid) revid = self._dostore(oid, revid)
perstorage = self.openClientStorage(cache="test") perstorage = self.openClientStorage(cache="test")
forker.wait_until(
(lambda : perstorage.verify_result == "quick verification"),
onfail=(lambda : None))
self.assertEqual(perstorage.verify_result, "quick verification") self.assertEqual(perstorage.verify_result, "quick verification")
self.assertEqual(perstorage._server._last_invals, self.assertEqual(perstorage._server._last_invals,
(revid, [oid])) (revid, [oid]))
......
...@@ -47,10 +47,10 @@ A current client should be able to connect to a old server: ...@@ -47,10 +47,10 @@ A current client should be able to connect to a old server:
>>> conn2.root()['blob2'].open('w').write('blob data 2') >>> conn2.root()['blob2'].open('w').write('blob data 2')
>>> transaction.commit() >>> transaction.commit()
>>> @wait_until("Get the new data")
>>> conn.sync() ... def f():
>>> conn.root().x ... conn.sync()
5 ... return conn.root().x == 5
>>> db.close() >>> db.close()
...@@ -132,9 +132,10 @@ Note that we'll have to pull some hijinks: ...@@ -132,9 +132,10 @@ Note that we'll have to pull some hijinks:
>>> transaction.commit() >>> transaction.commit()
>>> conn.sync() >>> @wait_until()
>>> conn.root().x ... def x_to_be_5():
5 ... conn.sync()
... return conn.root().x == 5
>>> db.close() >>> db.close()
......
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