Commit 0a0ccef1 authored by Samuel Gaist's avatar Samuel Gaist

[test][test_worker] Pass port as parameter to the custom process

parent 5bfa0b76
Pipeline #49578 passed with stage
in 22 minutes and 7 seconds
......@@ -149,10 +149,11 @@ def prepare_database(db_name):
class ControllerProcess(multiprocessing.Process):
def __init__(self, queue):
def __init__(self, queue, port):
super(ControllerProcess, self).__init__()
self.queue = queue
self.port = port
def run(self):
self.queue.put("STARTED")
......@@ -165,7 +166,7 @@ class ControllerProcess(multiprocessing.Process):
self.controller = WorkerController(
"127.0.0.1",
port=PORT,
port=self.port,
callbacks=dict(onWorkerReady=onWorkerReady, onWorkerGone=onWorkerGone),
)
......@@ -340,7 +341,7 @@ class TestConnection(TestWorkerBase):
self.wait_for_worker_connection(WORKER1)
def test_scheduler_shutdown(self):
controller = ControllerProcess(multiprocessing.Queue())
controller = ControllerProcess(multiprocessing.Queue(), PORT)
controller.start()
message = controller.queue.get()
......@@ -355,7 +356,7 @@ class TestConnection(TestWorkerBase):
sleep(1)
controller = ControllerProcess(multiprocessing.Queue())
controller = ControllerProcess(multiprocessing.Queue(), PORT)
controller.start()
message = controller.queue.get()
......
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