Commit e2d477c7 authored by Barry Warsaw's avatar Barry Warsaw

Make sure defunct processes are actually wait'd on.

parent f6d29c7f
...@@ -75,6 +75,10 @@ class CommonSetupTearDown(StorageTestBase): ...@@ -75,6 +75,10 @@ class CommonSetupTearDown(StorageTestBase):
for adminaddr in self._servers: for adminaddr in self._servers:
if adminaddr is not None: if adminaddr is not None:
forker.shutdown_zeo_server(adminaddr) forker.shutdown_zeo_server(adminaddr)
if hasattr(os, 'waitpid'):
# Not in Windows Python until 2.3
for pid in self._pids:
os.waitpid(pid, 0)
for i in 0, 1: for i in 0, 1:
path = "c1-test-%d.zec" % i path = "c1-test-%d.zec" % i
if os.path.exists(path): if os.path.exists(path):
...@@ -201,8 +205,6 @@ class ConnectionTests(CommonSetupTearDown): ...@@ -201,8 +205,6 @@ class ConnectionTests(CommonSetupTearDown):
# We don't want the read-write server created by setUp() # We don't want the read-write server created by setUp()
self.shutdownServer() self.shutdownServer()
self._servers = [] self._servers = []
self._pids = []
# Start a read-only server # Start a read-only server
self.startServer(create=0, index=0, ro_svr=1) self.startServer(create=0, index=0, ro_svr=1)
# Start a read-only client # Start a read-only client
...@@ -224,8 +226,6 @@ class ConnectionTests(CommonSetupTearDown): ...@@ -224,8 +226,6 @@ class ConnectionTests(CommonSetupTearDown):
# We don't want the read-write server created by setUp() # We don't want the read-write server created by setUp()
self.shutdownServer() self.shutdownServer()
self._servers = [] self._servers = []
self._pids = []
# Start a read-only server # Start a read-only server
self.startServer(create=0, index=0, ro_svr=1) self.startServer(create=0, index=0, ro_svr=1)
# Start a read-only-fallback client # Start a read-only-fallback client
...@@ -248,7 +248,6 @@ class ConnectionTests(CommonSetupTearDown): ...@@ -248,7 +248,6 @@ class ConnectionTests(CommonSetupTearDown):
# Shut down the server # Shut down the server
self.shutdownServer() self.shutdownServer()
self._servers = [] self._servers = []
self._pids = []
# Poll until the client disconnects # Poll until the client disconnects
self.pollDown() self.pollDown()
# Stores should fail now # Stores should fail now
...@@ -431,8 +430,6 @@ class ReconnectionTests(CommonSetupTearDown): ...@@ -431,8 +430,6 @@ class ReconnectionTests(CommonSetupTearDown):
# We don't want the read-write server created by setUp() # We don't want the read-write server created by setUp()
self.shutdownServer() self.shutdownServer()
self._servers = [] self._servers = []
self._pids = []
# Start a read-only server # Start a read-only server
self.startServer(create=0, index=0, read_only=1) self.startServer(create=0, index=0, read_only=1)
# Start a read-only client # Start a read-only client
...@@ -446,8 +443,6 @@ class ReconnectionTests(CommonSetupTearDown): ...@@ -446,8 +443,6 @@ class ReconnectionTests(CommonSetupTearDown):
# We don't want the read-write server created by setUp() # We don't want the read-write server created by setUp()
self.shutdownServer() self.shutdownServer()
self._servers = [] self._servers = []
self._pids = []
# Start a read-only server # Start a read-only server
self.startServer(create=0, index=0, read_only=1) self.startServer(create=0, index=0, read_only=1)
# Start a read-only-fallback client # Start a read-only-fallback client
...@@ -467,7 +462,6 @@ class ReconnectionTests(CommonSetupTearDown): ...@@ -467,7 +462,6 @@ class ReconnectionTests(CommonSetupTearDown):
# Shut down the server # Shut down the server
self.shutdownServer() self.shutdownServer()
self._servers = [] self._servers = []
self._pids = []
# Poll until the client disconnects # Poll until the client disconnects
self.pollDown() self.pollDown()
# Stores should still fail # Stores should still fail
...@@ -492,7 +486,6 @@ class ReconnectionTests(CommonSetupTearDown): ...@@ -492,7 +486,6 @@ class ReconnectionTests(CommonSetupTearDown):
# Shut down the server # Shut down the server
self.shutdownServer() self.shutdownServer()
self._servers = [] self._servers = []
self._pids = []
# Poll until the client disconnects # Poll until the client disconnects
self.pollDown() self.pollDown()
# Stores should fail now # Stores should fail now
...@@ -512,8 +505,6 @@ class ReconnectionTests(CommonSetupTearDown): ...@@ -512,8 +505,6 @@ class ReconnectionTests(CommonSetupTearDown):
# We don't want the read-write server created by setUp() # We don't want the read-write server created by setUp()
self.shutdownServer() self.shutdownServer()
self._servers = [] self._servers = []
self._pids = []
# Start a read-only server # Start a read-only server
self.startServer(create=0, read_only=1) self.startServer(create=0, read_only=1)
# Start a client in fallback mode # Start a client in fallback mode
...@@ -524,7 +515,6 @@ class ReconnectionTests(CommonSetupTearDown): ...@@ -524,7 +515,6 @@ class ReconnectionTests(CommonSetupTearDown):
# Shut down the server # Shut down the server
self.shutdownServer() self.shutdownServer()
self._servers = [] self._servers = []
self._pids = []
# Poll until the client disconnects # Poll until the client disconnects
self.pollDown() self.pollDown()
# Stores should fail now # Stores should fail now
...@@ -544,8 +534,6 @@ class ReconnectionTests(CommonSetupTearDown): ...@@ -544,8 +534,6 @@ class ReconnectionTests(CommonSetupTearDown):
# We don't want the read-write server created by setUp() # We don't want the read-write server created by setUp()
self.shutdownServer() self.shutdownServer()
self._servers = [] self._servers = []
self._pids = []
# Allocate a second address (for the second server) # Allocate a second address (for the second server)
self._newAddr() self._newAddr()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment