test(auth): timestamp quota fixtures under fake clock - #3143
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe two pool-auth websocket tests now install the fake ChangesPool-auth test timing
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This test-only change makes quota fixtures use the same fake clock as startup initialization without changing production authentication behavior; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
Superseded by #3147, which landed on Closing this per your own note on #3147 — you said you would close the duplicate once the owner-authored PR landed, so I am doing the bookkeeping rather than making you come back for it. The diagnosis here was yours and it was right: One thing worth recording, since it was your framing on #3147 and I disagreed with part of it after tracing the code. The missing seed could not have moved Thanks for the catch on both counts. |
Summary
Why
The follow-up in #3139 moved the fake clock before
startServer, butupdateAccountQuotastill ran first under the real clock. The asynchronous startup prime then compared a future fake-clock read with a real-clockupdatedAt, could classify the fresh row as stale, and rotate the credential before the first request.This reproduced as the macOS assertion failure in #3121 at
tests/server-auth.test.ts:2302: the first request observed the refreshed credential instead of the old one. #3121 does not modify this test, so the failure is an upstream fixture race rather than a regression in that PR.Verification
Exact head:
1e50927f5b8a7ad6b9bca5835cc1e27d1b7f1eedtests/server-auth.test.tscases passed 5 consecutive focused runs (10 tests total, 0 failed).bun run typecheckpassed.git diff --checkpassed.HOME,OPENCODEX_HOME, andCODEX_HOME; protected local runtime config hashes were unchanged.Checklist
Summary by CodeRabbit