Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--amend
Browse files Browse the repository at this point in the history
xjules committed Dec 12, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent a9e4798 commit 79588cd
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/ert/scheduler/job.py
Original file line number Diff line number Diff line change
@@ -85,6 +85,9 @@ async def __call__(

await self._send(State.RUNNING)
returncode = await self.returncode
# we need to make sure that the task has finished too
await self.driver.wait_to_finish(self.real.iens)

if (
returncode == 0
and forward_model_ok(self.real.run_arg).status
4 changes: 4 additions & 0 deletions src/ert/scheduler/local_driver.py
Original file line number Diff line number Diff line change
@@ -23,6 +23,10 @@ async def kill(self, iens: int) -> None:
except KeyError:
return

async def wait_to_finish(self, iens: int):
# we might need to do some timeout here I guess
await self._tasks[iens]

async def _wait_until_finish(
self, iens: int, executable: str, /, *args: str, cwd: str
) -> None:
3 changes: 1 addition & 2 deletions tests/unit_tests/scheduler/test_scheduler.py
Original file line number Diff line number Diff line change
@@ -121,6 +121,5 @@ async def test_that_max_submit_was_reached(tmp_path: Path, realization):
sch.add_realization(realization, callback_timeout=lambda _: None)
create_jobs_json(tmp_path, [step])
sch.add_dispatch_information_to_jobs_file()
scheduler_task = asyncio.create_task(sch.execute())
await scheduler_task
assert await sch.execute() == EVTYPE_ENSEMBLE_STOPPED
assert (tmp_path / "cnt").read_text() == "3\n"

0 comments on commit 79588cd

Please sign in to comment.