diff --git a/src/_ert/forward_model_runner/client.py b/src/_ert/forward_model_runner/client.py index f98b7449af1..e178dc02690 100644 --- a/src/_ert/forward_model_runner/client.py +++ b/src/_ert/forward_model_runner/client.py @@ -116,7 +116,8 @@ async def send(self, message: str, retries: int | None = None) -> None: self._ack_event.clear() backoff = 1 - retries = retries or self.DEFAULT_MAX_RETRIES + if retries is None: + retries = self.DEFAULT_MAX_RETRIES while retries >= 0: try: await self.socket.send_multipart([b"", message.encode("utf-8")]) diff --git a/src/_ert/forward_model_runner/reporting/event.py b/src/_ert/forward_model_runner/reporting/event.py index 1d6b9100517..2915406ed27 100644 --- a/src/_ert/forward_model_runner/reporting/event.py +++ b/src/_ert/forward_model_runner/reporting/event.py @@ -182,10 +182,7 @@ def _job_handler(self, msg: Start | Running | Exited): self._dump_event(event) def _finished_handler(self, _): - self._event_queue.put(Event._sentinel) - self._done.set() - if self._event_publisher_thread.is_alive(): - self._event_publisher_thread.join() + self.stop() def _checksum_handler(self, msg: Checksum): fm_checksum = ForwardModelStepChecksum( diff --git a/tests/ert/unit_tests/forward_model_runner/test_event_reporter.py b/tests/ert/unit_tests/forward_model_runner/test_event_reporter.py index 32c62f574b0..b906340dc1e 100644 --- a/tests/ert/unit_tests/forward_model_runner/test_event_reporter.py +++ b/tests/ert/unit_tests/forward_model_runner/test_event_reporter.py @@ -191,7 +191,7 @@ def test_report_with_failed_reporter_but_finished_jobs(unused_tcp_port): url = f"tcp://{host}:{unused_tcp_port}" with MockZMQServer(unused_tcp_port) as mock_server: reporter = Event( - evaluator_url=url, ack_timeout=2, max_retries=1, finished_event_timeout=2 + evaluator_url=url, ack_timeout=2, max_retries=0, finished_event_timeout=2 ) fmstep1 = ForwardModelStep( {"name": "fmstep1", "stdout": "stdout", "stderr": "stderr"}, 0