[Zodb-checkins] SVN: ZODB/trunk/src/ZEO/tests/testZEO.py Try to avoid spurious failure due to test race

Jim Fulton jim at zope.com
Thu Sep 30 11:44:20 EDT 2010


Log message for revision 117092:
  Try to avoid spurious failure due to test race
  

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

-=-
Modified: ZODB/trunk/src/ZEO/tests/testZEO.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/testZEO.py	2010-09-30 15:38:10 UTC (rev 117091)
+++ ZODB/trunk/src/ZEO/tests/testZEO.py	2010-09-30 15:44:19 UTC (rev 117092)
@@ -1380,9 +1380,12 @@
     >>> addr, _ = start_server()
     >>> db = ZEO.DB(addr, client_label='test-label-1')
     >>> db.close()
-    >>> for line in open('server-%s.log' % addr[1]):
-    ...     if 'test-label-1' in line:
-    ...         print line.split()[1:4]
+    >>> @wait_until
+    ... def check_for_test_label_1():
+    ...    for line in open('server-%s.log' % addr[1]):
+    ...        if 'test-label-1' in line:
+    ...            print line.split()[1:4]
+    ...            return True
     ['INFO', 'ZEO.StorageServer', '(test-label-1']
 
 You can specify the client label via a configuration file as well:
@@ -1397,9 +1400,12 @@
     ... </zodb>
     ... ''' % addr[1])
     >>> db.close()
-    >>> for line in open('server-%s.log' % addr[1]):
-    ...     if 'test-label-2' in line:
-    ...         print line.split()[1:4]
+    >>> @wait_until
+    ... def check_for_test_label_2():
+    ...    for line in open('server-%s.log' % addr[1]):
+    ...        if 'test-label-2' in line:
+    ...            print line.split()[1:4]
+    ...            return True
     ['INFO', 'ZEO.StorageServer', '(test-label-2']
 
     """



More information about the Zodb-checkins mailing list