Commit 5f4af306 authored by Vincent Pelletier's avatar Vincent Pelletier

Also stop clients in NEOCluster.stop.

But make it optional, as some tests might want to stop everything
except clients (stopping single processes is already possible
separately).

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2388 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent cbb7371f
......@@ -157,6 +157,7 @@ class NEOCluster(object):
cleanup_on_delete=False, temp_dir=None,
clear_databases=True, adapter='MySQL',
verbose=True):
self.zodb_storage_list = []
self.cleanup_on_delete = cleanup_on_delete
self.verbose = verbose
self.uuid_set = set()
......@@ -308,7 +309,7 @@ class NEOCluster(object):
self.expectClusterRunning()
neoctl.enableStorageList([x[2] for x in storage_node_list])
def stop(self):
def stop(self, clients=True):
for process_list in self.process_dict.itervalues():
for process in process_list:
try:
......@@ -316,6 +317,10 @@ class NEOCluster(object):
process.wait()
except AlreadyStopped:
pass
if clients:
for zodb_storage in self.zodb_storage_list:
zodb_storage.close()
self.zodb_storage_list = []
time.sleep(0.5)
def getNEOCTL(self):
......@@ -323,13 +328,15 @@ class NEOCluster(object):
def getZODBStorage(self):
master_nodes = self.master_nodes.replace('/', ' ')
return Storage(
result = Storage(
master_nodes=master_nodes,
name=self.cluster_name,
connector='SocketConnector',
logfile=os.path.join(self.temp_dir, 'client.log'),
verbose=self.verbose,
)
self.zodb_storage_list.append(result)
return result
def getZODBConnection(self):
""" Return a tuple with the database and a connection """
......
......@@ -89,7 +89,7 @@ class ClusterTests(NEOFunctionalTest):
db, conn = self.neo.getZODBConnection()
conn.root()[0] = 'ok'
transaction.commit()
self.neo.stop()
self.neo.stop(clients=False)
# XXX: (obj|trans) become t(obj|trans)
self.neo.switchTables('test_neo1')
self.neo.start()
......
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