Repository navigation
test(digest): pin the digest-hour case to fixed summer and winter instants (unblocks CI) - #3121
Conversation
…tants 15:01 UTC is 08:00 in Los Angeles only under PDT. The test built 15:01 on the current date, so it went red for every PR and the merge queue when daylight saving ended on 2026-11-01, and would have stayed red until March. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015AKgpQmb6BbxDrAtw45bgN
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Scheduled-run timezone assertions backend/__tests__/unit/services/dailyDigestService.membership.test.js |
The test checks Los Angeles selection at 15:01 UTC in summer and 16:01 UTC in winter. It also checks no-timezone user selection at 06:01 UTC in winter. The comment notes that Los Angeles’s 08:00 UTC offset depends on the date. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Possibly related PRs
- Team-Commonly/commonly#2618: Adds watcher-driven users to the scheduled candidate query and tests scheduled task-only delivery.
Merge Risk: 
Minimal · up to f23cb
-
This test-only change provides reliable coverage for summer, winter, and no-timezone digest scheduling behavior.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title names the changed test and the fix: it pins the digest-hour case to fixed summer and winter instants, which matches the test-only change in dailyDigestService.membership.test.js. It also states the CI-unblocking purpose. The title is specific and accurate, so it passes.
Full details: Description check
-
Explanation
The description states the failing test, the root cause (a fixed UTC-to-Los Angeles assumption that breaks after DST ended on 2026-11-01), and the test-only fix with three fixed-instant cases. It also lists the test results and a mutation check. It directly describes the changeset, so it passes.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015AKgpQmb6BbxDrAtw45bgN
lilyshen0722
left a comment
There was a problem hiding this comment.
One review round (D218), recorded at f23cb04: the writer's own subagent review, then CodeRabbit and CI.
- Subagent review: 0 blocking, 4 non-blocking. It verified the 2026 DST dates, checked that
generateAllDailyDigestsreads onlyaton the scheduled path, and found no other today-dependent zone test inbackend/__tests__. Two nits are fixed in f23cb04: a stale comment, and a no-zone 06:01Z row so the no-zone assertion isn't vacuous. The other two (a redundant helper check, the assertion shape) were folded in. - CodeRabbit: passed, with no threads.
- CI:
Test & Coveragepassed, and Backend tests 3/3 is green again, which is the shard this fixes.E2E Testshit its 30-minute limit. It isn't a required check, and this PR changes one backend unit-test file.
GATE: PASS
Unblocks the merge queue. Every PR's backend shard 3, and the queue's own runs (the #3107 group, for one), have been red since 00:00Z on 11-01 on a single test:
dailyDigestService.membership.test.js› "a scheduled run takes only the people for whom it is the hour"Cause: the test built
laEightas 15:01 UTC on the current date and asserted that this is 08:00 in America/Los_Angeles. That holds only under PDT (UTC-7). Daylight saving ended at 09:00Z on 2026-11-01, so from that UTC date on, 15:01Z is 07:01 PST and the assert fails. It would have stayed red until 2027-03-14. The service isn't involved.Fix (test only): the case now runs on fixed instants, never today's date.
generateAllDailyDigeststakesatand reads no other clock on the scheduled path. So pinningat, and derivinglastActivefrom it, fixes the test for good, with no fake timers. It's now three cases:The no-zone person is never due at any of them, because its hour is 06:00 UTC.
Tests:
dueAthard-coded to 15 UTC for any zone, both winter cases fail.timeZone.test.js) already uses a fixed date.Tier 1, test only. Its one review round is the writer's subagent review, then CodeRabbit and CI.
🤖 Generated with Claude Code
https://claude.ai/code/session_015AKgpQmb6BbxDrAtw45bgN