Skip to content

Commit

Permalink
refactor to Unexpected
Browse files Browse the repository at this point in the history
  • Loading branch information
fran-tirapu committed Nov 6, 2024
1 parent 2d71b49 commit 0e2de60
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Version 0.54.2
-------------

**Bugfixes**
- Introduce a new retrying condition for `altool` commands as part of `app-store-connect` action when unknown return codes occurs. [PR #435](https://github.com/codemagic-ci-cd/cli-tools/pull/435)
- Introduce a new retrying condition for `altool` commands as part of `app-store-connect` action when unexpected return codes occurs. [PR #435](https://github.com/codemagic-ci-cd/cli-tools/pull/435)


Version 0.54.1
Expand Down
2 changes: 1 addition & 1 deletion src/codemagic/models/altool/altool.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def _hide_environment_variable_values(cls, altool_output: Optional[AnyStr]) -> s

def _should_retry_command(self, command_error: AltoolCommandError) -> bool:
if command_error.return_code in [-5, -11]:
self.logger.info(f"Unknown altool exit code {command_error.return_code}, retrying...")
self.logger.info(f"Unexpected altool exit code {command_error.return_code}, retrying...")
return True
patterns = (
re.compile("Unable to authenticate.*-19209"),
Expand Down
4 changes: 2 additions & 2 deletions tests/models/altool/test_altool_retrying.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ def test_retrying_command_by_return_code_and_success(caplog, mock_altool, mock_s
result = mock_altool.upload_app(pathlib.Path("app.ipa"), retries=4, retry_wait_seconds=0)

assert result is mock_success_result
assert caplog.text.count("Unknown altool exit code -11, retrying...") == 1
assert caplog.text.count("Unknown altool exit code -5, retrying...") == 2
assert caplog.text.count("Unexpected altool exit code -11, retrying...") == 1
assert caplog.text.count("Unexpected altool exit code -5, retrying...") == 2


@mock.patch.object(PlatformType, "from_path", lambda _artifact_path: PlatformType.IOS)
Expand Down

0 comments on commit 0e2de60

Please sign in to comment.