Skip to content

Commit

Permalink
Rem max_retries
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Dec 6, 2024
1 parent 81512a4 commit 9be8ace
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 70 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
import asyncio

import websockets

from _ert.async_utils import new_event_loop
from _ert.events import (
EnsembleStarted,
EnsembleSucceeded,
ForwardModelStepRunning,
ForwardModelStepSuccess,
RealizationSuccess,
RealizationUnknown,
event_to_json,
)
from _ert.forward_model_runner.client import Client
from ert.config import QueueConfig
from ert.ensemble_evaluator import Ensemble
from ert.ensemble_evaluator._ensemble import ForwardModelStep, Realization
Expand Down Expand Up @@ -44,53 +29,7 @@ def __init__(self, _iter, reals, fm_steps, id_):
super().__init__(the_reals, {}, QueueConfig(), 0, id_)

async def evaluate(self, config, _, __):
event_id = 0
async with Client(
config.get_connection_info().router_uri,
cert=config.cert,
token=config.token,
max_retries=1,
dealer_name="dispatch_eval",
) as dispatch:
event = EnsembleStarted(ensemble=self.id_)
await dispatch._send(event_to_json(event))

event_id += 1
for real in range(0, self.test_reals):
real = str(real)

event = RealizationUnknown(ensemble=self.id_, real=real)
await dispatch._send(event_to_json(event))

event_id += 1
for fm_step in range(0, self.fm_steps):
fm_step = str(fm_step)

event = ForwardModelStepRunning(
ensemble=self.id_,
real=real,
fm_step=fm_step,
current_memory_usage=1000,
)
await dispatch._send(event_to_json(event))
event_id += 1

event = ForwardModelStepSuccess(
ensemble=self.id_,
real=real,
fm_step=fm_step,
current_memory_usage=1000,
)
await dispatch._send(event_to_json(event))
event_id += 1
event_id += 1

event = RealizationSuccess(ensemble=self.id_, real=real)
await dispatch._send(event_to_json(event))
event_id += 1

event = EnsembleSucceeded(ensemble=self.id_)
await dispatch._send(event_to_json(event))
pass

@property
def cancellable(self) -> bool:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_invalid_server():
pytest.raises(
ClientConnectionError, match="Connection to evaluator not established!"
),
Client(url, max_retries=2, connection_timeout=1.0),
Client(url, connection_timeout=1.0),
):
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ async def test_restarted_jobs_do_not_have_error_msgs(evaluator_to_use):
url,
cert=cert,
token=token,
max_retries=1,
dealer_name="dispatch_from_test_1",
) as dispatch:
event = ForwardModelStepRunning(
Expand Down Expand Up @@ -210,7 +209,6 @@ def is_completed_snapshot(snapshot: EnsembleSnapshot) -> bool:
url,
cert=cert,
token=token,
max_retries=1,
) as dispatch:
event = ForwardModelStepSuccess(
ensemble=evaluator.ensemble.id_,
Expand Down Expand Up @@ -258,13 +256,11 @@ async def test_new_monitor_can_pick_up_where_we_left_off(evaluator_to_use):
url,
cert=cert,
token=token,
max_retries=1,
) as dispatch1,
Client(
url,
cert=cert,
token=token,
max_retries=1,
) as dispatch2,
):
# first dispatch endpoint client informs that forward model 0 is running
Expand Down Expand Up @@ -324,7 +320,6 @@ def check_if_all_fm_running(snapshot: EnsembleSnapshot) -> bool:
url,
cert=cert,
token=token,
max_retries=1,
) as dispatch2:
# second dispatch endpoint client informs that job 0 is done
event = ForwardModelStepSuccess(
Expand Down Expand Up @@ -394,13 +389,11 @@ async def test_dispatch_endpoint_clients_can_connect_and_monitor_can_shut_down_e
url,
cert=cert,
token=token,
max_retries=1,
) as dispatch1,
Client(
url,
cert=cert,
token=token,
max_retries=1,
) as dispatch2,
):
# first dispatch endpoint client informs that real 0 fm 0 is running
Expand Down

0 comments on commit 9be8ace

Please sign in to comment.