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): ...@@ -90,17 +90,14 @@ class PortAllocator(object):
def release(self): def release(self):
for s in self.socket_list: for s in self.socket_list:
s.close() s.close()
self.socket_list = None self.__init__()
def reset(self): def reset(self):
if self.lock.locked(): if self.lock.locked():
self.allocator_set.pop(self, None) self.allocator_set.pop(self, None)
if not self.allocator_set: if not self.allocator_set:
self.lock.release() self.lock.release()
if self.socket_list: self.release()
for s in self.socket_list:
s.close()
self.__init__()
__del__ = reset __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