Nataneljpwd commented on code in PR #63016:
URL: https://github.com/apache/airflow/pull/63016#discussion_r2900422703
##########
airflow-ctl/tests/airflow_ctl/api/test_client.py:
##########
@@ -314,3 +324,55 @@ def test_save_skips_patch_for_non_encrypted_backend(self,
mock_keyring):
assert not hasattr(mock_backend, "_get_new_password")
mock_keyring.set_password.assert_called_once_with("airflowctl",
"api_token_production", "token")
+
+ def test_retry_handling_unrecoverable_error(self):
+ with time_machine.travel("2023-01-01T00:00:00Z", tick=False):
+ responses: list[httpx.Response] = [
+ *[httpx.Response(500, text="Internal Server Error")] * 6,
+ httpx.Response(200, json={"detail": "Recovered from error -
but will fail before"}),
+ httpx.Response(400, json={"detail": "Should not get here"}),
+ ]
+ client = make_client_w_responses(responses)
+
+ with pytest.raises(httpx.HTTPStatusError) as err:
+ client.get("http://error")
+ assert not isinstance(err.value, ServerResponseError)
+ assert len(responses) == 5
+
Review Comment:
Yes, it is clear but it takes a second to understand, it is a nice to have
rather than a must
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]