Repository navigation
test: deflake the persistent 429 stall test with a stopped throttler clock - #2331
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2331 +/- ##
==========================================
- Coverage 94.15% 94.04% -0.11%
==========================================
Files 184 184
Lines 13644 13644
==========================================
- Hits 12846 12832 -14
- Misses 798 812 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vdusek
marked this pull request as ready for review
October 15, 2026 08:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_persistent_429_raises_after_stall[retry_on_blocked]failed on ubuntu / Python 3.10 (run) withDID NOT RAISE PersistentRateLimitError. The other 17 legs of the same run passed.The test put the domain into a 50 to 100 ms backoff and let real time pass through a 1.2 s
max_domain_stall. The crawler defers a 429 only ifis_throttled()still holds when it handles the error, and on a loaded runner the backoff ran out first. Withmax_request_retries=0the request then took the ordinary-error path, got marked as handled, and the run ended without an error. A 120 ms delay injected into that check reproduces the failure on every run.The throttler now runs on a stopped
Mockclock with a 1-minute backoff, as in #2275. The clock moves one backoff forward each time the idle crawler asks for a stall reason, andmax_domain_stallsits between one and two backoffs, so the domain stalls on the check after its second 429. The assertions are unchanged, and the test still fails when_is_held_backis forced toFalse. It also finishes in well under a second.The stall tests in the basic crawler suite keep the 50 ms backoff. They run with the default three retries, so a lost race there only spends one of the retries.
✍️ Drafted by Claude Code