You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(tests): _rate_limiter singleton not reset in test teardown -- rate limit state leaks between tests #297
_configure_settings teardown in tests/conftest.py at line ~272 resets _api_key_store but not the _rate_limiter singleton. Tests that monkeypatch get_rate_limiter or the _rate_limiter module-level variable leave the modified instance in place for subsequent tests, causing state leaks.
Fix
tests/conftest.py teardown: also reset the _rate_limiter singleton:
import backend.app.security.rate_limit as _rl_mod
_rl_mod._rate_limiter = None
Or call monkeypatch.setattr(_rl_mod, "_rate_limiter", None) in the fixture.
Impact
Rate-limiter state from one test leaks into subsequent tests, causing intermittent failures when window counts from a previous test affect the rate-limit check in a later test.
Activity
fix(sprint-r4): root-cause fixes for all 17 bugs from code review rou…
piyushmakhija28 commentedon Jun 21, 2026
Fixed in PR #280 (Sprint R3/R4: fix(sprint-r3): root-cause fixes for all 39 bugs from code review round 3 + Sprint R4 round 4)