[Zodb-checkins] SVN: ZODB/trunk/src/ZEO/tests/testConnection.py Use some updated testing APIs and output extra debugging info on

Jim Fulton jim at zope.com
Thu Sep 9 16:03:30 EDT 2010


Log message for revision 116281:
  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.
  

Changed:
  U   ZODB/trunk/src/ZEO/tests/testConnection.py

-=-
Modified: ZODB/trunk/src/ZEO/tests/testConnection.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/testConnection.py	2010-09-09 20:03:27 UTC (rev 116280)
+++ ZODB/trunk/src/ZEO/tests/testConnection.py	2010-09-09 20:03:29 UTC (rev 116281)
@@ -145,18 +145,13 @@
 
 - starting a server
 
-    >>> import ZEO.tests.testZEO, ZEO.tests.forker
-    >>> 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])
+    >>> addr, _ = start_server()
 
 - opening a client to the server that writes some objects, filling
   it's cache at the same time,
 
-    >>> import ZEO.ClientStorage, ZODB.tests.MinPO, transaction
-    >>> db = ZODB.DB(ZEO.ClientStorage.ClientStorage(addr, client='x'))
+    >>> import ZODB.tests.MinPO, transaction
+    >>> db = ZEO.DB(addr, client='x')
     >>> conn = db.open()
     >>> nobs = 1000
     >>> for i in range(nobs):
@@ -172,7 +167,7 @@
 
     >>> import random, threading, time
     >>> stop = False
-    >>> db2 = ZODB.DB(ZEO.ClientStorage.ClientStorage(addr))
+    >>> db2 = ZEO.DB(addr)
     >>> tm = transaction.TransactionManager()
     >>> conn2 = db2.open(transaction_manager=tm)
     >>> random = random.Random(0)
@@ -197,6 +192,7 @@
     >>> handler = zope.testing.loggingsupport.InstalledHandler(
     ...    'ZEO', level=logging.ERROR)
 
+    >>> bad = False
     >>> try:
     ...     for c in range(10):
     ...        time.sleep(.1)
@@ -214,11 +210,15 @@
     ...                if conn.root()[i].value != conn2.root()[i].value:
     ...                    print 'bad', c, i, conn.root()[i].value,
     ...                    print  conn2.root()[i].value
+    ...                    bad = True
     ...        db.close()
     ... finally:
     ...     stop = True
     ...     thread.join(10)
 
+    >>> if bad:
+    ...    print open('server-%s.log' % addr[1]).read()
+
     >>> thread.isAlive()
     False
 
@@ -230,9 +230,6 @@
 
     >>> db.close()
     >>> db2.close()
-    >>> ZEO.tests.forker.shutdown_zeo_server(adminaddr)
-
-
     """ # '
 
 def test_suite():



More information about the Zodb-checkins mailing list