Skip to content

Commit

Permalink
fix(retriever): avoid infinite loop if sbatch command fails (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle authored and laurent-laporte-pro committed Apr 11, 2024
1 parent 3af94d1 commit a9324f7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ npx auto-changelog -l false --hide-empty-releases -v v1.3.1 -o CHANGES.out.md

- feat(ssh): add retry loop around SSH Exceptions [`#68`](https://github.com/AntaresSimulatorTeam/antares-launcher/pull/68)

### Fixes

- fix(retriever): avoid infinite loop if sbatch command fails [`#69`](https://github.com/AntaresSimulatorTeam/antares-launcher/pull/69)


## [1.3.1] - 2023-09-26

Expand Down
2 changes: 1 addition & 1 deletion antareslauncher/use_cases/retrieve/state_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def run(self, study: StudyDTO) -> None:
Args:
study: The study data transfer object
"""
if not study.done:
if not study.done and not study.with_error:
# set current study job state flags
if study.job_id:
s, f, e = self._env.get_job_state_flags(study)
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/retriever/test_study_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ def test_given_done_study_nothing_is_done(self):
self.reporter.save_study.assert_not_called()
self.zip_extractor.extract_final_zip.assert_not_called()

@pytest.mark.unit_test
def test_given_study_with_error_study_is_still_in_error(self):
env = mock.Mock()
display = mock.Mock()
self.state_updater = StateUpdater(env=env, display=display)
study_with_error = StudyDTO(path="hello", with_error=True)
self.study_retriever.retrieve(study_with_error)
assert study_with_error.with_error

@pytest.mark.unit_test
def test_retrieve_study(self):
"""
Expand Down

0 comments on commit a9324f7

Please sign in to comment.