Commit f3bdbd04 authored by Guido van Rossum's avatar Guido van Rossum

Make sure the child process doesn't raise an exception and continue

running the rest of the tests in the child.
parent a75cce21
...@@ -56,6 +56,7 @@ def start_server(addr): ...@@ -56,6 +56,7 @@ def start_server(addr):
def start_client(addr, client_func=None): def start_client(addr, client_func=None):
pid = os.fork() pid = os.fork()
if pid == 0: if pid == 0:
try:
import ZEO.ClientStorage import ZEO.ClientStorage
if VERBOSE: if VERBOSE:
print "Client process started:", os.getpid() print "Client process started:", os.getpid()
...@@ -65,6 +66,7 @@ def start_client(addr, client_func=None): ...@@ -65,6 +66,7 @@ def start_client(addr, client_func=None):
else: else:
client_func(cli) client_func(cli)
cli.close() cli.close()
finally:
os._exit(0) os._exit(0)
else: else:
return pid return pid
......
...@@ -91,6 +91,7 @@ def start_child(zaddr): ...@@ -91,6 +91,7 @@ def start_child(zaddr):
if pid != 0: if pid != 0:
return pid return pid
try:
storage = ClientStorage(zaddr, debug=1, min_disconnect_poll=0.5) storage = ClientStorage(zaddr, debug=1, min_disconnect_poll=0.5)
db = ZODB.DB(storage, pool_size=NUM_CONNECTIONS) db = ZODB.DB(storage, pool_size=NUM_CONNECTIONS)
setup(db.open()) setup(db.open())
...@@ -116,6 +117,7 @@ def start_child(zaddr): ...@@ -116,6 +117,7 @@ def start_child(zaddr):
c.__count += 1 c.__count += 1
work(c) work(c)
finally:
os._exit(0) os._exit(0)
if __name__ == "__main__": if __name__ == "__main__":
......
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