[Zodb-checkins] CVS: ZODB3/ZEO/tests - ConnectionTests.py:1.19

Barry Warsaw barry@wooz.org
Mon, 27 Jan 2003 18:49:45 -0500


Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv13395

Modified Files:
	ConnectionTests.py 
Log Message:
pollUp(): Take an optional storage argument and poll on that if given.

checkNoVerificationOnServerRestartWith2Clients(): Pass perstorage to
pollUp(), which should eliminate the None != 'no verification'
failures.


=== ZODB3/ZEO/tests/ConnectionTests.py 1.18 => 1.19 ===
--- ZODB3/ZEO/tests/ConnectionTests.py:1.18	Fri Jan 17 12:20:04 2003
+++ ZODB3/ZEO/tests/ConnectionTests.py	Mon Jan 27 18:49:41 2003
@@ -145,11 +145,13 @@
             forker.shutdown_zeo_server(adminaddr)
             self._servers[index] = None
 
-    def pollUp(self, timeout=30.0):
+    def pollUp(self, timeout=30.0, storage=None):
+        if storage is None:
+            storage = self._storage
         # Poll until we're connected
         now = time.time()
         giveup = now + timeout
-        while not self._storage.is_connected():
+        while not storage.is_connected():
             asyncore.poll(0.1)
             now = time.time()
             if now > giveup:
@@ -645,14 +647,15 @@
         self.pollDown()
         self._storage.verify_result = None
         perstorage.verify_result = None
+        zLOG.LOG("testZEO", zLOG.INFO, '2ALLBEEF')
         self.startServer(create=0)
         self.pollUp()
+        self.pollUp(storage=perstorage)
         # There were no transactions committed, so no verification
         # should be needed.
         self.assertEqual(self._storage.verify_result, "no verification")
-
-        perstorage.close()
         self.assertEqual(perstorage.verify_result, "no verification")
+        perstorage.close()
 
     def checkQuickVerificationWith2Clients(self):
         perstorage = self.openClientStorage(cache="test")