fix(sync): don't try a timed-out feed again

A request that hung for the full timeout says the way out is hanging, not
that the endpoint is flaky; three of them per channel stretched a poll over
a dead egress to about three times its interval.
This commit is contained in:
2026-09-19 03:42:26 +02:00
parent 142593083f
commit 1c49870a7a
2 changed files with 15 additions and 2 deletions
+8
View File
@@ -282,6 +282,14 @@ class TestRssErrorVsEmpty:
assert rss.fetch_channel_feed("UC_blip")
assert len(tries) == 2
def test_a_timeout_is_not_tried_again(self, monkeypatch):
# A hung request already cost the full timeout; retrying it would triple a poll over a
# dead egress.
tries, waits = self._answers(monkeypatch, httpx.ReadTimeout("hung"), 200)
with pytest.raises(rss.RssError) as err:
rss.fetch_channel_feed("UC_hung")
assert (len(tries), waits, err.value.reason) == (1, [], "transport")
def test_a_feed_that_keeps_failing_raises_its_last_failure(self, monkeypatch):
tries, _ = self._answers(monkeypatch, 500, 404, 404)
with pytest.raises(rss.RssError) as err: