Skip to content

test(timeutil): use 2025 historical Havana fall-back sample - #701

Merged
Willxup merged 1 commit into
Willxup:mainfrom
Moraxyc:test-timeutil-fix
Nov 11, 2026
Merged

Willxup merged 1 commit into
Willxup:mainfrom
Moraxyc:test-timeutil-fix

Conversation

@Moraxyc

@Moraxyc Moraxyc commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Summary

TestDayBoundsUsesRealCalendarDate asserts that America/Havana falls back from -04 to -05 on 2026-11-01. The IANA tz database longer has that transition, so the test fails against current tzdata even though DayBounds returns the correct result.

Background

The unreleased section of the tz NEWS file says:

Cuba will not fall back to -05 on 2026-11-01 and instead plans to maintain -04 through 2027-11-07.

The northamerica rules now have no November transition for 2026, and the next fall-back is 2027-11-07 (Rule Cuba 2027 max - v Sun>=1 0:00s 0 S).

Reproduction

With tzdata compiled from upstream tz HEAD (eb40bc6, 2026-11-08) and ZONEINFO pointing at it:

calendar_test.go:35: bounds={Start:2026-11-01 00:00:00 -0400 CDT End:2026-11-02 00:00:00 -0400 CDT} present=true, want
2026-11-01T00:00:00-04:00..2026-11-02T00:00:00-05:00

Suggest

This test hard-codes expected transitions from one tzdata version, so it is brittle and will need updating whenever tzdata changes these rules; a fixture-based or invariant-based test would be more robust.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T10:23:52.779554Z 9c41524 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Willxup

Willxup commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Thanks for the fix! Could we use the historical Havana fall-back date 2025-11-02 instead of 2027-11-07?

Both tzdb 2025b and the current upstream rules include this transition. It preserves the original repeated-midnight / 25-hour-day coverage without depending on a future transition that could change again:

// Use a historical fall-back day with a repeated midnight.
{"America/Havana", "2025-11-02", "2025-11-02T00:00:00-04:00", "2025-11-03T00:00:00-05:00"},

The underlying fix makes sense; this would make the replacement sample more stable.

@Moraxyc Moraxyc changed the title test(timeutil): use 2027 Havana fall-back sample test(timeutil): use 2025 historical Havana fall-back sample Nov 11, 2026
@Willxup
Willxup merged commit 0fabaa0 into Willxup:main Nov 11, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants