Commit 3cc71593 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[test][bcp] Typo and code fixes

parent c2b93143
Pipeline #34097 passed with stage
in 40 minutes and 42 seconds
...@@ -173,7 +173,7 @@ class ZMQWorkerProcess(multiprocessing.Process): ...@@ -173,7 +173,7 @@ class ZMQWorkerProcess(multiprocessing.Process):
# ---------------------------------------------------------- # ----------------------------------------------------------
class ExcecutionTestCase(unittest.TestCase): class ExecutionTestCase(unittest.TestCase):
def setUp(self): def setUp(self):
self.MAX_ITERATION_COUNT = int( self.MAX_ITERATION_COUNT = int(
os.environ.get("BPC_MAX_ITERATION_COUNT", DEFAULT_MAX_ITERATION_COUNT) os.environ.get("BPC_MAX_ITERATION_COUNT", DEFAULT_MAX_ITERATION_COUNT)
...@@ -232,7 +232,7 @@ class TestBroker(unittest.TestCase): ...@@ -232,7 +232,7 @@ class TestBroker(unittest.TestCase):
self.assertEqual(queue_messages[1], "gone") self.assertEqual(queue_messages[1], "gone")
class TestBCP(ExcecutionTestCase): class TestBCP(ExecutionTestCase):
use_docker = False use_docker = False
docker_images_cache = None docker_images_cache = None
...@@ -352,16 +352,21 @@ class TestBCPDocker(TestBCP): ...@@ -352,16 +352,21 @@ class TestBCPDocker(TestBCP):
cls.host = Host(images_cache=cls.docker_images_cache, raise_on_errors=False) cls.host = Host(images_cache=cls.docker_images_cache, raise_on_errors=False)
class TestExcecutionProcess(ExcecutionTestCase): class TestExecutionProcess(ExecutionTestCase):
address = "ipc://execution_feed" REMOTE_ADDRESS = "ipc://execution_feed"
def tearDown(self): def tearDown(self):
os.remove(self.address.split("//")[1]) os.remove(self.REMOTE_ADDRESS.split("//")[1])
def setup_process(self): def setup_process(self):
self.prepare_databases(CONFIGURATION1) self.prepare_databases(CONFIGURATION1)
process = ExecutionProcess( process = ExecutionProcess(
self.address, b"1", prefix, CONFIGURATION1, tmp_prefix, VERBOSE_BCP_LOGGING self.REMOTE_ADDRESS,
b"1",
prefix,
CONFIGURATION1,
tmp_prefix,
VERBOSE_BCP_LOGGING,
) )
process.start() process.start()
return process return process
...@@ -370,7 +375,7 @@ class TestExcecutionProcess(ExcecutionTestCase): ...@@ -370,7 +375,7 @@ class TestExcecutionProcess(ExcecutionTestCase):
ctx = zmq.Context() ctx = zmq.Context()
socket = ctx.socket(zmq.ROUTER) socket = ctx.socket(zmq.ROUTER)
socket.linger = 0 socket.linger = 0
socket.bind(self.address) socket.bind(self.REMOTE_ADDRESS)
poller = zmq.Poller() poller = zmq.Poller()
poller.register(socket, zmq.POLLIN) poller.register(socket, zmq.POLLIN)
...@@ -410,7 +415,9 @@ class TestExcecutionProcess(ExcecutionTestCase): ...@@ -410,7 +415,9 @@ class TestExcecutionProcess(ExcecutionTestCase):
def test_processor(self): def test_processor(self):
poller = zmq.Poller() poller = zmq.Poller()
processor = BeatComputationProcessor(poller, self.address, VERBOSE_BCP_LOGGING) processor = BeatComputationProcessor(
poller, self.REMOTE_ADDRESS, VERBOSE_BCP_LOGGING
)
process = self.setup_process() process = self.setup_process()
......
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