test: DST & timezone guarantees (spec 3.1-3.4) + CI in UTC#540
Merged
Conversation
Add a DST guarantee matrix covering spring-forward gaps, fall-back overlaps, negative controls, and long stress enumerations across the spec's reference zones (New York, Lord Howe 30-min, Chatham 45-min offset, Havana midnight, Auckland southern hemisphere, London, Tokyo, UTC). Sequences are checked for the core invariants: strictly monotonic in absolute time, gaps >= the expression's interval (no rapid-fire), and every returned instant satisfies the expression (which proves no non-existent spring-forward wall-clock ever fires). The current matcher already satisfies every scenario; these tests prove and pin it. Run the unit suite under TZ=UTC, and add a dedicated job that runs it under TZ=America/Sao_Paulo to prove a task with an explicit timezone is unaffected by the system timezone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First PR of the DST hardening work (spec
05-spec-dst, staged into separate PRs). This one locks in the behavior we already have with an exhaustive guarantee matrix, and makes the test environment honest.What's here
src/time/dst.test.ts, 30 cases) covering §3.1 spring-forward, §3.2 fall-back, §3.3 negative controls, §3.4 long stress, across the spec's reference zones: New York, Lord Howe (30-min DST), Chatham (45-min offset), Havana (midnight DST), Auckland (southern hemisphere), London, Tokyo, UTC.TZ=UTC, plus a dedicatedTimezone independencejob that runs the whole suite underTZ=America/Sao_Pauloto prove a task with an explicit timezone is unaffected by the system timezone.Note
The current matcher (after the recent
MatcherWalker/localTimeToTimestamprewrite) already passes all 30 scenarios — including 30-min and 45-min zones, midnight gaps, and 1000-iteration per-second/minute monotonicity. This PR is characterization: it proves and pins the guarantees so future changes can't regress them.Skipped (depend on features that don't exist yet)
startAt/stopAt, FI-7getNextRuns(n), FI-2LockProvider— out of scope for DST.Next PRs
utcOffset(fixed numeric offset, no DST) + its scenarios (CN-3).Full suite green: 310 tests under both
TZ=UTCandTZ=America/Sao_Paulo.