fix: build schedule-fallback fixtures in Kyiv time, not the runner's - #116
Merged
Conversation
The three schedule-fallback cases wrote their departure maps with the process clock, but stopScheduleService reads those maps as Europe/Kyiv since 93b4beb. On a Kyiv laptop the two agreed and the suite passed; on the UTC CI runner the fixture landed three hours off, no departure matched, and the fallback assertions failed.
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.
Problem
Test (26.x)fails onmasterwith three failures intests/services/stopArrivalService.test.js:serves scheduled departures when the live feed predicts nothingfalls back to the schedule when the arrivals feed itself failsstill reports the live feed as empty when the schedule fills inThey look flaky — the same three failed on every open Dependabot PR regardless of which package was bumped — but they are deterministic: they fail on any runner not set to Kyiv time.
Cause
services/stopScheduleService.js:20pins schedule reads toEurope/Kyiv(since 93b4beb). The test fixtures still built theirstop_departure_time_map*entries off the process clock viagetHours(). On a Kyiv laptop the two agree and the suite passes; on the UTC CI runner the fixture lands three hours off, no departure matches the horizon, and the fallback assertions see an empty result.Fix
Build the fixture times in
Europe/Kyiv, matching the zone the service reads them back in — the same "pin the zone" conventiontests/services/stopScheduleService.test.jsalready uses.Verification
Pre-fix,
TZ=UTCreproduces exactly the three CI failures; post-fix they pass. Full suite, 209/209:UTCEurope/KyivAmerica/Los_AngelesTest-only change; no production code touched.