[Zodb-checkins] CVS: ZEO/ZEO/tests - testZEO.py:1.16.4.4.2.14

Jeremy Hylton jeremy@zope.com
Thu, 30 May 2002 23:55:48 -0400


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

Modified Files:
      Tag: ZEO2-branch
	testZEO.py 
Log Message:
One last fix.  Looks like tests work on Unix and Windows now.

Restore UnixConnectionTests to cover the differences in starting and
stopping servers on Unix and Windows.  The previous checkin
inadvertantly deleted all the Unix-specific code.



=== ZEO/ZEO/tests/testZEO.py 1.16.4.4.2.13 => 1.16.4.4.2.14 ===
         zLOG.LOG("checkReconnection", zLOG.INFO, "finished")
 
+class UnixConnectionTests(ConnectionTests):
+    
+    def _startServer(self, create=1, index=0):
+        path = "%s.%d" % (self.file, index)
+        addr = self.addr[index]
+        pid, server = forker.start_zeo_server('FileStorage',
+                                              (path, create), addr)
+        self._pids.append(pid)
+        self._servers.append(server)
+
+    def shutdownServer(self, index=0):
+        if self.running:
+            self.running = 0
+            self._servers[index].close()
+            try:
+                os.waitpid(self._pids[index], 0)
+            except os.error:
+                pass
+
 class WindowsConnectionTests(ConnectionTests):
     
     def _startServer(self, create=1, index=0):
@@ -381,7 +400,7 @@
             time.sleep(0.5)
 
 if os.name == "posix":
-    test_classes = ZEOFileStorageTests, ConnectionTests
+    test_classes = ZEOFileStorageTests, UnixConnectionTests
 elif os.name == "nt":
     test_classes = WindowsZEOFileStorageTests, WindowsConnectionTests
 else: