[Checkins] SVN: ZODB/trunk/src/ZEO/tests/testConnection.py Tweaked debugging info again.

Jim Fulton jim at zope.com
Fri Sep 24 12:09:02 EDT 2010


Log message for revision 116787:
  Tweaked debugging info again.
  

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-24 15:12:47 UTC (rev 116786)
+++ ZODB/trunk/src/ZEO/tests/testConnection.py	2010-09-24 16:09:02 UTC (rev 116787)
@@ -167,7 +167,7 @@
     ...    'ZEO', level=logging.DEBUG)
 
     >>> logging.getLogger('ZEO').debug(
-    ...     'Initial tid %s' % conn.root()._p_serial)
+    ...     'Initial tid %r' % conn.root()._p_serial)
 
 - disconnecting the first client (closing it with a persistent cache),
 
@@ -208,12 +208,16 @@
     ...        time.sleep(.1)
     ...        db = ZODB.DB(ZEO.ClientStorage.ClientStorage(addr, client='x'))
     ...        with lock:
-    ...            @wait_until("connected and we've caught up", timeout=199)
+    ...            logging.getLogger('ZEO').debug('Locked %s' % c)
+    ...            @wait_until("connected and we have caught up", timeout=199)
     ...            def _():
-    ...                return (db.storage.is_connected()
+    ...                if (db.storage.is_connected()
     ...                        and db.storage.lastTransaction()
     ...                            == db.storage._server.lastTransaction()
-    ...                        )
+    ...                        ):
+    ...                    logging.getLogger('ZEO').debug(
+    ...                       'Connected %r' % db.storage.lastTransaction())
+    ...                    return True
     ...
     ...            conn = db.open()
     ...            for i in range(1000):
@@ -221,10 +225,10 @@
     ...                    print 'bad', c, i, conn.root()[i].value,
     ...                    print  conn2.root()[i].value
     ...                    bad = True
-    ...                    print 'client debug log'
+    ...                    print 'client debug log with lock held'
     ...                    while handler.records:
     ...                          record = handler.records.pop(0)
-    ...                          print record.name, record.levelname
+    ...                          print record.name, record.levelname,
     ...                          print handler.format(record)
     ...        if bad:
     ...           print open('server-%s.log' % addr[1]).read()
@@ -248,7 +252,7 @@
 
     >>> db.close()
     >>> db2.close()
-    """ # '
+    """
 
 def test_suite():
     suite = unittest.TestSuite()



More information about the checkins mailing list