Commit 351dfdd5 authored by Jim Fulton's avatar Jim Fulton

Use wait_until to avoid spurious test failures on challenged machines.

parent 33800b70
......@@ -4,7 +4,7 @@ Invalidations while connecting
As soon as a client registers with a server, it will recieve
invalidations from the server. The client must be careful to queue
these invalidations until it is ready to deal with them. At the time
of the writing of this test, clients weren't careful enogh about
of the writing of this test, clients weren't careful enough about
queing invalidations. This led to cache corruption in the form of
both low-level file corruption as well as out-of-date records marked
as current.
......@@ -72,11 +72,13 @@ This tests tries to provoke this bug by:
... db = ZODB.DB(ZEO.ClientStorage.ClientStorage(addr, client='x'))
... _ = lock.acquire()
... try:
... time.sleep(.1)
... assert (db.storage.lastTransaction()
... == db.storage._server.lastTransaction()), (
... db.storage.lastTransaction(),
... db.storage._server.lastTransactiion())
... wait_until("connected and we've caught up",
... lambda :
... db.storage.is_connected()
... and db.storage.lastTransaction()
... == db.storage._server.lastTransaction()
... )
...
... conn = db.open()
... for i in range(1000):
... if conn.root()[i].value != conn2.root()[i].value:
......
......@@ -135,7 +135,7 @@ def test_suite():
suite.addTest(sub)
suite.addTest(doctest.DocFileSuite(
'invalidations_while_connecting.test',
setUp=setupstack.setUpDirectory, tearDown=setupstack.tearDown,
setUp=ZEO.tests.forker.setUp, tearDown=setupstack.tearDown,
))
suite.layer = ZODB.tests.util.MininalTestLayer('ZEO Connection Tests')
return suite
......
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