Commit 899609b1 authored by Philip ABBET's avatar Philip ABBET
Browse files

[tests] Fix a problem with the successive binding of lots of sockets to random ports

parent 9e0b0be6
Pipeline #12083 failed with stage
in 14 minutes and 27 seconds
...@@ -59,7 +59,7 @@ class Server(MessageHandler): ...@@ -59,7 +59,7 @@ class Server(MessageHandler):
self.socket = self.context.socket(zmq.PAIR) self.socket = self.context.socket(zmq.PAIR)
self.address = 'tcp://' + host_address self.address = 'tcp://' + host_address
port = self.socket.bind_to_random_port(self.address) port = self.socket.bind_to_random_port(self.address, min_port=50000)
self.address += ':%d' % port self.address += ':%d' % port
logger.debug("zmq server bound to `%s'", self.address) logger.debug("zmq server bound to `%s'", self.address)
......
...@@ -102,7 +102,7 @@ class HostSide(object): ...@@ -102,7 +102,7 @@ class HostSide(object):
# 0MQ server # 0MQ server
self.socket = zmq_context.socket(zmq.PAIR) self.socket = zmq_context.socket(zmq.PAIR)
self.address = 'tcp://127.0.0.1' self.address = 'tcp://127.0.0.1'
port = self.socket.bind_to_random_port(self.address) port = self.socket.bind_to_random_port(self.address, min_port=50000)
self.address += ':%d' % port self.address += ':%d' % port
database = Database(prefix, 'integers_db/1') database = Database(prefix, 'integers_db/1')
......
...@@ -100,7 +100,7 @@ class TestMessageHandler(unittest.TestCase): ...@@ -100,7 +100,7 @@ class TestMessageHandler(unittest.TestCase):
self.server_context = zmq.Context() self.server_context = zmq.Context()
server_socket = self.server_context.socket(zmq.PAIR) server_socket = self.server_context.socket(zmq.PAIR)
address = 'tcp://127.0.0.1' address = 'tcp://127.0.0.1'
port = server_socket.bind_to_random_port(address) port = server_socket.bind_to_random_port(address, min_port=50000)
address += ':%d' % port address += ':%d' % port
self.message_handler = MessageHandler(self.input_list, self.server_context, server_socket) self.message_handler = MessageHandler(self.input_list, self.server_context, server_socket)
...@@ -190,7 +190,7 @@ class TestMessageHandlerErrorHandling(unittest.TestCase): ...@@ -190,7 +190,7 @@ class TestMessageHandlerErrorHandling(unittest.TestCase):
self.server_context = zmq.Context() self.server_context = zmq.Context()
server_socket = self.server_context.socket(zmq.PAIR) server_socket = self.server_context.socket(zmq.PAIR)
address = 'tcp://127.0.0.1' address = 'tcp://127.0.0.1'
port = server_socket.bind_to_random_port(address) port = server_socket.bind_to_random_port(address, min_port=50000)
address += ':%d' % port address += ':%d' % port
self.message_handler = MessageHandler(self.input_list, self.server_context, server_socket) self.message_handler = MessageHandler(self.input_list, self.server_context, server_socket)
......
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