Commit 4d19ced5 authored by Jim Fulton's avatar Jim Fulton

Use some updated testing APIs and output extra debugging info on

failure to deal with a test failure that occurs often in a buildbot,
but that I don't get myself *even* when running on the same machine as
the bot.
parent 923d56ff
...@@ -145,18 +145,13 @@ This tests tries to provoke this bug by: ...@@ -145,18 +145,13 @@ This tests tries to provoke this bug by:
- starting a server - starting a server
>>> import ZEO.tests.testZEO, ZEO.tests.forker >>> addr, _ = start_server()
>>> addr = 'localhost', ZEO.tests.testZEO.get_port()
>>> zconf = ZEO.tests.forker.ZEOConfig(addr)
>>> sconf = '<filestorage 1>\npath Data.fs\n</filestorage>\n'
>>> _, adminaddr, pid, conf_path = ZEO.tests.forker.start_zeo_server(
... sconf, zconf, addr[1])
- opening a client to the server that writes some objects, filling - opening a client to the server that writes some objects, filling
it's cache at the same time, it's cache at the same time,
>>> import ZEO.ClientStorage, ZODB.tests.MinPO, transaction >>> import ZODB.tests.MinPO, transaction
>>> db = ZODB.DB(ZEO.ClientStorage.ClientStorage(addr, client='x')) >>> db = ZEO.DB(addr, client='x')
>>> conn = db.open() >>> conn = db.open()
>>> nobs = 1000 >>> nobs = 1000
>>> for i in range(nobs): >>> for i in range(nobs):
...@@ -172,7 +167,7 @@ This tests tries to provoke this bug by: ...@@ -172,7 +167,7 @@ This tests tries to provoke this bug by:
>>> import random, threading, time >>> import random, threading, time
>>> stop = False >>> stop = False
>>> db2 = ZODB.DB(ZEO.ClientStorage.ClientStorage(addr)) >>> db2 = ZEO.DB(addr)
>>> tm = transaction.TransactionManager() >>> tm = transaction.TransactionManager()
>>> conn2 = db2.open(transaction_manager=tm) >>> conn2 = db2.open(transaction_manager=tm)
>>> random = random.Random(0) >>> random = random.Random(0)
...@@ -197,6 +192,7 @@ This tests tries to provoke this bug by: ...@@ -197,6 +192,7 @@ This tests tries to provoke this bug by:
>>> handler = zope.testing.loggingsupport.InstalledHandler( >>> handler = zope.testing.loggingsupport.InstalledHandler(
... 'ZEO', level=logging.ERROR) ... 'ZEO', level=logging.ERROR)
>>> bad = False
>>> try: >>> try:
... for c in range(10): ... for c in range(10):
... time.sleep(.1) ... time.sleep(.1)
...@@ -214,11 +210,15 @@ This tests tries to provoke this bug by: ...@@ -214,11 +210,15 @@ This tests tries to provoke this bug by:
... if conn.root()[i].value != conn2.root()[i].value: ... if conn.root()[i].value != conn2.root()[i].value:
... print 'bad', c, i, conn.root()[i].value, ... print 'bad', c, i, conn.root()[i].value,
... print conn2.root()[i].value ... print conn2.root()[i].value
... bad = True
... db.close() ... db.close()
... finally: ... finally:
... stop = True ... stop = True
... thread.join(10) ... thread.join(10)
>>> if bad:
... print open('server-%s.log' % addr[1]).read()
>>> thread.isAlive() >>> thread.isAlive()
False False
...@@ -230,9 +230,6 @@ This tests tries to provoke this bug by: ...@@ -230,9 +230,6 @@ This tests tries to provoke this bug by:
>>> db.close() >>> db.close()
>>> db2.close() >>> db2.close()
>>> ZEO.tests.forker.shutdown_zeo_server(adminaddr)
""" # ' """ # '
def test_suite(): def test_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