Commit ae298622 authored by André Anjos's avatar André Anjos 💬
Browse files

Randomize db-server port (closes #51)

parent 31042900
......@@ -33,6 +33,7 @@ from __future__ import absolute_import
import os
import requests
import zmq
import random
import sys
import subprocess as sp
import tempfile
......@@ -239,6 +240,7 @@ class SubprocessExecutor(RemoteExecutor):
#----- (If necessary) Instantiate the subprocess that provide the databases
databases_process = None
database_port = random.randint(51000, 60000)
if len(self.databases) > 0:
......@@ -248,9 +250,10 @@ class SubprocessExecutor(RemoteExecutor):
# Creation of the subprocess
# Note: we only support one databases image loaded at the same time
cmd = [
DBPROVIDER_BIN,
self.ip_address + ':51000',
self.ip_address + (':%d' % database_port),
databases_configuration_path,
self.cache,
]
......@@ -280,7 +283,7 @@ class SubprocessExecutor(RemoteExecutor):
]
if len(self.databases) > 0:
cmd.append('tcp://' + self.ip_address + ':51000')
cmd.append('tcp://' + self.ip_address + (':%d' % database_port))
if logger.getEffectiveLevel() <= logging.DEBUG:
cmd.insert(1, '--debug')
......
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