Repository navigation
test: hold the usage snapshot burst clock fixed - #24551
Conversation
|
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 5 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
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. Comment |
|
ELI5
A test assumed 31 disk writes would finish before the rate limiter replenished a token. On a busy machine they sometimes take longer, so the test failed even though the limiter worked correctly.
What Changed
Hold
Date.now()fixed in the rate-limited usage-snapshot test while keeping real asynchronous disk writes. Assert that retrying after a reset captures exactly one additional snapshot with the original revision.Why
The limiter replenishes one token every two seconds. Advancing a controlled clock by 100ms per report reproduced the full-suite failure (31 captures instead of 30). A fixed clock makes this a deterministic burst, instead of increasing timeouts or changing the production limit. The existing mock cleanup restores the clock after the test.
Linked Issue
N/A — maintainer test audit.
Visual Proof
N/A — test-only change.
Testing
macOS: controlled slow-burst reproduction failed as expected; the corrected reporter and burst-cap suites passed all 23 tests. Targeted lint, formatting, changed-code quality and diff checks passed. Standard repository typecheck passed during this audit. Full desktop suite rerun follows this merge; production build and non-macOS coverage remain for CI.
Review
Self-reviewed the clock scope, mock cleanup, real disk persistence and retry count/revision assertions.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
No production, UI, SSH, mobile or platform behavior changes.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)