Repository navigation
Test: pin the Earlier alerts clock so it stops failing just after midnight - #3561
Conversation
The file used the real clock, so alerts made a few minutes ago landed under Yesterday in the first minutes after Perth midnight and two tests failed. Faking only Date keeps timers real for waitFor. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KhogQUCHgdtFBHFtpjnd1n
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Warning Review limit reachedYour organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Next included review available in 26 minutes. View limit details
Comment |
🏁 CodeAnt Quality Gate ResultsCommit: ✅ Overall Status: PASSEDQuality Gate Details
|
There was a problem hiding this comment.
BigSimmo has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
CI failed: The required 'PR required' aggregate check went red because static-pr and both browser lanes were cancelled with no genuine failing job; the cancellation looks like a superseded or hand-cancelled run, not a break caused by this test change.OverviewOne unique error template was found across 1 log. The aggregate check failed only because three jobs (static-pr, production-ui-critical, production-ui) reported a cancelled result, and no job actually failed. The log explicitly states the cancellation does not describe the diff. FailuresRequired 'PR required' aggregate check failed on cancelled jobs (confidence: high)
Summary
Code Review ✅ Approved🟢 Low risk · Pins Date in one test file and restores real timers afterward, limiting impact to deterministic test behavior without changing production code. Pins the Earlier alerts test clock to midday in Perth by faking only VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Approved For more verification details, comment Tip Comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Important Your trial ends in 6 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more. Was this helpful? React with 👍 / 👎 | Gitar |
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
PR Summary by QodoPin Earlier alerts tests to Perth midday
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt |
Qodo FixerNo findings are available for this PR yet. Findings appear here once Qodo has reviewed the PR. |
CodeAnt PR Risk: Low Risk
Assessed commit: |
|
Cancelled. View session → |
User description
Summary
Before: the Earlier alerts test file used the real clock. In the first minutes after Perth midnight, alerts made "a few minutes ago" fell under Yesterday, and two tests failed on any PR that ran then.
After: the file pins the clock to midday in Perth, so the tests give the same result at any hour.
How:
vi.useFakeTimers({ toFake: ["Date"] })withvi.setSystemTimeinbeforeEach, andvi.useRealTimers()inafterEach. Only Date is faked, so timers stay real forwaitFor.Areas touched: Delivery and assurance (test only)
Verification
Tests 2 failed | 26 passed (28), reproducing the failure seen on Two-user privacy test for the database, and run the SQL behaviour tests in CI #3556.Tests 28 passed (28).Risk and rollout
🤖 Generated with Claude Code
https://claude.ai/code/session_01KhogQUCHgdtFBHFtpjnd1n
Generated by Claude Code
Summary by cubic
Pins the Earlier alerts test clock to midday in Perth so the tests no longer fail just after midnight.
The file previously used the real clock, so alerts made "a few minutes ago" fell under Yesterday in the first minutes after Perth midnight and two tests failed.
vi.useFakeTimersnow fakes onlyDateinbeforeEach, keeping timers real forwaitFor, andvi.useRealTimers()restores them inafterEach.Written for commit 0ec2cb4. Summary will update on new commits.
CodeAnt-AI Description
Prevent Earlier alerts tests from failing after Perth midnight
What Changed
Impact
✅ Stable Earlier alerts tests after Perth midnight✅ Real timers remain available for test waits💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.