Repository navigation
fix(auth): the rate-limit deadline test passes on a busy machine - #659
Merged
Merged
Conversation
…ock its usual deadline The test bounded both requests by the 1-second deadline it set for the blocked one, so on a busy machine the request after the lock was released could take longer and get a 504. That request now goes through the fixture's own deadline; the blocked one still gets one second. Closes #658
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 52 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
rate_limit_deadline_includes_a_blocked_database_queryfailed on a busy machine. It sets a 1-second request deadline, holds the rate-limit bucket's lock and expects a504. Then it releases the lock and expects the next request to get a202. But that second request went through the same 1-second deadline, and on a loaded machine (load average 130 to 170) it sometimes took longer and got a504.The second request now goes through the fixture's own 30-second deadline. The blocked request still gets 1 second, so the test still proves the deadline bounds waiting for a locked bucket. Nothing is skipped, and production code is unchanged.
Proof: before the fix, the test failed 1 of 4 runs alone and once in a full
just db test(load average about 166). After it, 4 of 4 runs passed alone at load average 90 to 110. Clippy passes.Closes #658
Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)