Commit 531a7df7 authored by Julien Muchembled's avatar Julien Muchembled

Do not waste too much file system space when running tests

parent 2553b1c9
...@@ -361,16 +361,25 @@ class NEOCluster(object): ...@@ -361,16 +361,25 @@ class NEOCluster(object):
raise AssertionError('Timeout when starting cluster') raise AssertionError('Timeout when starting cluster')
def stop(self, clients=True): def stop(self, clients=True):
error_list = [] # Suspend all processes to kill before actually killing them, so that
# nodes don't log errors because they get disconnected from other nodes:
# otherwise, storage nodes would often flush MB of logs just because we
# killed the master first, and waste much file system space.
stopped_list = []
for process_list in self.process_dict.itervalues(): for process_list in self.process_dict.itervalues():
for process in process_list: for process in process_list:
try: try:
process.kill(signal.SIGKILL) process.kill(signal.SIGSTOP)
process.wait() stopped_list.append(process)
except AlreadyStopped: except AlreadyStopped:
pass pass
except NodeProcessError, e: error_list = []
error_list += e.args for process in stopped_list:
try:
process.kill(signal.SIGKILL)
process.wait()
except NodeProcessError, e:
error_list += e.args
if clients: if clients:
for zodb_storage in self.zodb_storage_list: for zodb_storage in self.zodb_storage_list:
zodb_storage.close() zodb_storage.close()
......
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