Skip to content

fix(auth): the rate-limit deadline test passes on a busy machine - #659

Merged
PiquelChips merged 1 commit into
mainfrom
fix/658-rate-limit-deadline-test
Nov 21, 2026
Merged

PiquelChips merged 1 commit into
mainfrom
fix/658-rate-limit-deadline-test

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

rate_limit_deadline_includes_a_blocked_database_query failed on a busy machine. It sets a 1-second request deadline, holds the rate-limit bucket's lock and expects a 504. Then it releases the lock and expects the next request to get a 202. 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 a 504.

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)

…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
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c29191ef-c07b-44e5-b84f-95d8606dac89
Commits

Reviewing files that changed from the base of the PR and between 9dc56d8 and daab095.

Files selected for processing: 1

  • apps/auth-service/src/security/tests/rate_limits.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@PiquelChips
PiquelChips marked this pull request as ready for review November 21, 2026 18:50
@PiquelChips
PiquelChips added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 1a38d2c Nov 21, 2026
13 checks passed
@PiquelChips
PiquelChips deleted the fix/658-rate-limit-deadline-test branch November 21, 2026 19:11
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in sourceorigin.dev Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(auth): the rate-limit deadline test passes on a busy machine

1 participant