fix(news): 연결 재시도 2회로 보강 — 드랍이 연결 단위 랜덤(재시도 1회도 연속 피격 실측) + 빈 에러 로그 repr
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -139,12 +139,20 @@ class TestConnectRetry:
|
||||
assert resp == "OK" and client.calls == 2
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_persistent_connect_error_propagates(self):
|
||||
async def test_second_retry_absorbs_consecutive_drop(self):
|
||||
"""드랍이 연결 단위 랜덤이라 재시도 1회도 연속으로 걸림 (MOEL lawinfo 실측)."""
|
||||
import httpx
|
||||
client = self._Client([httpx.ConnectError(""), httpx.ConnectError("")])
|
||||
resp = await news_collector._get_with_connect_retry(client, "https://x/feed")
|
||||
assert resp == "OK" and client.calls == 3
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_persistent_connect_error_propagates(self):
|
||||
import httpx
|
||||
client = self._Client([httpx.ConnectError("")] * 3)
|
||||
with pytest.raises(httpx.ConnectError):
|
||||
await news_collector._get_with_connect_retry(client, "https://x/feed")
|
||||
assert client.calls == 2 # 1회만 재시도 — 지속 장애는 circuit 몫
|
||||
assert client.calls == 3 # 최대 2회 재시도 — 지속 장애는 circuit 몫
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_non_connect_errors_not_retried(self):
|
||||
|
||||
Reference in New Issue
Block a user