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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user