def _run_search_node(self, config: dict, q: multiprocessing.Queue):
        from utils.src.python.Monitoring import init
        init(config["search_config"].get("search_prometheus_log_file"))

        from network_oef.src.python.SearchNode import SearchNode
        from utils.src.python.Logging import configure as configure_logging, get_logger
        configure_logging(file=config["search_log"])
        logger = get_logger("NODE_RUN: " + config["search_key"])

        search_node = SearchNode(config)

        logger.info("**** Node started @ {}:{}".format(config["host"],
                                                       config["search_port"]))
        time.sleep(1)
        try:
            while True:
                con = q.get()
                logger.info("**** SearchProcess got peer: %s @ %s ", con[2],
                            con[0] + ":" + str(con[1]))
                if len(con) != 3:
                    logger.error(
                        "**** Stopping connection queue listening, because invalid con: ",
                        con)
                    break
                search_node.connect_to_search_node(*con)
            search_node.block()
        except Exception as e:
            logger.exception("Exception in run_search_node: ", e)
        except:
            logger.exception("Exception")
        logger.error("******* EXIT SEARCH NODE")
Exemple #2
0
import unittest
import sys

from utils.src.python.Monitoring import init
init(testMode=True)

from dap_api.src.python import DapInterface
from dap_api.src.python import DapManager
from dap_api.src.python import DapQueryRepn
from dap_in_memory.src.python import InMemoryDap
from dap_api.src.protos import dap_update_pb2
from fetch_teams.oef_core_protocol import query_pb2


class DapManagerTest(unittest.TestCase):
    def setUp(self):
        """Call before every test case."""
        self.dapManager = DapManager.DapManager()

        dapManagerConfig = {
            "dap1": {
                "class": "InMemoryDap",
                "config": {
                    "structure": {
                        "wibbles": {
                            "wibble": "string"
                        },
                    },
                },
            },
            "dap2": {
import unittest
from utils.src.python.Logging import configure as configure_logging
from utils.src.python.Monitoring import init, shutdown

init()
shutdown()

from pluto_app.test.python.PlutoTest import PlutoTest

configure_logging()
unittest.main()  # run all tests