From 9d14a2e1a9035c10b660fdb35396fec829f713d9 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 29 Aug 2023 09:02:43 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> --- .../peer_communicator/background_peer_state.py | 2 +- .../peer_communication/test_add_peer_forward_and_close.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/exasol_advanced_analytics_framework/udf_communication/peer_communicator/background_peer_state.py b/exasol_advanced_analytics_framework/udf_communication/peer_communicator/background_peer_state.py index 2746d910..9c89dc29 100644 --- a/exasol_advanced_analytics_framework/udf_communication/peer_communicator/background_peer_state.py +++ b/exasol_advanced_analytics_framework/udf_communication/peer_communicator/background_peer_state.py @@ -43,7 +43,7 @@ def _create_receive_socket(self): self._receive_socket.bind(receive_socket_address) def try_send(self): - self._logger.debug("resend_if_necessary") + self._logger.debug("try_send") self._connection_establisher.try_send() def received_synchronize_connection(self): diff --git a/tests/integration_tests/without_db/udf_communication/peer_communication/test_add_peer_forward_and_close.py b/tests/integration_tests/without_db/udf_communication/peer_communication/test_add_peer_forward_and_close.py index 94cbcece..030e55c5 100644 --- a/tests/integration_tests/without_db/udf_communication/peer_communication/test_add_peer_forward_and_close.py +++ b/tests/integration_tests/without_db/udf_communication/peer_communication/test_add_peer_forward_and_close.py @@ -52,10 +52,8 @@ def run(parameter: PeerCommunicatorTestProcessParameter, queue: BidirectionalQue context = zmq.Context() socket_factory = ZMQSocketFactory(context) socket_factory = FaultInjectionSocketFactory(socket_factory, 0.01, RandomState(parameter.seed)) - leader = False leader_name = "i0" - if parameter.instance_name == leader_name: - leader = True + leader = True if parameter.instance_name == leader_name else False com = PeerCommunicator( name=parameter.instance_name, number_of_peers=parameter.number_of_instances, @@ -72,7 +70,7 @@ def run(parameter: PeerCommunicatorTestProcessParameter, queue: BidirectionalQue try: queue.put(com.my_connection_info) peer_connection_infos = queue.get() - if parameter.instance_name == leader_name: + if leader: for index, connection_info in peer_connection_infos.items(): com.register_peer(connection_info) finally: