Commit c93a786f authored by Julien Muchembled's avatar Julien Muchembled

Hack to allow restarting twice a cluster in functional tests

PortAllocator is broken by design and the only proper solution to run a NEO
functional test without race condition with another software opening a random
port is to use ... unix sockets.
parent 4720ba33
......@@ -90,17 +90,14 @@ class PortAllocator(object):
def release(self):
for s in self.socket_list:
s.close()
self.socket_list = None
self.__init__()
def reset(self):
if self.lock.locked():
self.allocator_set.pop(self, None)
if not self.allocator_set:
self.lock.release()
if self.socket_list:
for s in self.socket_list:
s.close()
self.__init__()
self.release()
__del__ = reset
......
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