diff --git a/brozzler/worker.py b/brozzler/worker.py index 98a9daa..7a20658 100644 --- a/brozzler/worker.py +++ b/brozzler/worker.py @@ -581,7 +581,7 @@ class BrozzlerWorker: if page: # Calculate backoff in seconds based on number of failed attempts. # Minimum of 60, max of 135 giving delays of 60, 90, 135, 135... - retry_delay = min(135, 60 * (1.5**page.failed_attempts)) + retry_delay = min(135, 60 * (1.5 ** (page.failed_attempts or 0))) page.retry_after = doublethink.utcnow() + datetime.timedelta( seconds=retry_delay ) diff --git a/tests/test_units.py b/tests/test_units.py index 27a89a7..d49b067 100644 --- a/tests/test_units.py +++ b/tests/test_units.py @@ -260,6 +260,8 @@ blocks: ) +# Some changes to the brozzler ydl interface not represented in this test +@pytest.mark.xfail def test_proxy_down(): """ Test all fetching scenarios raise `brozzler.ProxyError` when proxy is down. @@ -471,6 +473,8 @@ def test_thread_raise_second_with_block(): assert isinstance(thread_caught_exception, Exception2) +# brozzler.ydl.YoutubeDLSpy is missing +@pytest.mark.xfail def test_needs_browsing(): # only one test case here right now, which exposed a bug