Skip to content

test(common): pin the Beijing weekend shift with edge instants - #1114

Closed
rekty wants to merge 8801 commits into
CodebuffAI:mainfrom
rekty:fix/pin-beijing-weekend-shift-tests
Closed

test(common): pin the Beijing weekend shift with edge instants#1114
rekty wants to merge 8801 commits into
CodebuffAI:mainfrom
rekty:fix/pin-beijing-weekend-shift-tests

Conversation

@rekty

@rekty rekty commented Aug 25, 2026

Copy link
Copy Markdown

{
"title": "test(common): pin the Beijing weekend shift with edge instants",
"head": "rekty:fix/pin-beijing-weekend-shift-tests",
"base": "main",
"body": "Closes #1090\n\n## Problem\n\nBoth weekend tests sit at 02:00Z, inside the band where the +8h Beijing shift and a plain getUTCDay() agree. Deleting the shift leaves deepseekPricingWindow returning identical answers for all 168 hours of a week — the suite stays green, and the file only starts lying the day DeepSeek moves a window past 16:00Z.\n\n## Fix\n\n1. Export isBeijingWeekend from freebuff-peak-hours.ts (doc-comment explains why: the weekend band Fri 16:00Z → Sun 16:00Z never overlaps the peak windows, so only the predicate can pin the shift directly).\n2. Add four edge-pinning tests at the exact instants where the two calendars disagree:\n\n| instant | Beijing | weekend |\n|---|---|---|\n| 2026-08-28T15:00:00Z | Fri 23:00 | no |\n| 2026-08-28T16:00:00Z | Sat 00:00 | yes |\n| 2026-08-30T15:00:00Z | Sun 23:00 | yes |\n| 2026-08-30T16:00:00Z | Mon 00:00 | no |\n\n## Verification\n\n- All 24 tests in the file pass with the fix in place.\n- Mutation check: removing the + 8 * 60 * 60 * 1000 shift makes exactly the two boundary tests fail (16:00Z Friday and 16:00Z Sunday), confirming the suite now catches the regression.\n"
}

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:triaged Classified by the community triage bot pr:port-candidate Worth porting into the private source tree

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Both weekend tests stay green if the Beijing shift is removed

3 participants