Skip to content

fix: build schedule-fallback fixtures in Kyiv time, not the runner's - #116

Merged
vbhjckfd merged 1 commit into
masterfrom
fix/schedule-fallback-test-timezone
Aug 23, 2026
Merged

fix: build schedule-fallback fixtures in Kyiv time, not the runner's#116
vbhjckfd merged 1 commit into
masterfrom
fix/schedule-fallback-test-timezone

Conversation

@vbhjckfd

Copy link
Copy Markdown
Owner

Problem

Test (26.x) fails on master with three failures in tests/services/stopArrivalService.test.js:

  • serves scheduled departures when the live feed predicts nothing
  • falls back to the schedule when the arrivals feed itself fails
  • still reports the live feed as empty when the schedule fills in

They 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:20 pins schedule reads to Europe/Kyiv (since 93b4beb). The test fixtures still built their stop_departure_time_map* entries off the process clock via getHours(). 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" convention tests/services/stopScheduleService.test.js already uses.

Verification

Pre-fix, TZ=UTC reproduces exactly the three CI failures; post-fix they pass. Full suite, 209/209:

TZ Result
UTC 21 files, 209 passed
Europe/Kyiv 21 files, 209 passed
America/Los_Angeles 16/16 in the touched file

Test-only change; no production code touched.

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.
@vbhjckfd
vbhjckfd merged commit 888806f into master Aug 23, 2026
4 checks passed
@vbhjckfd
vbhjckfd deleted the fix/schedule-fallback-test-timezone branch August 23, 2026 19:47
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.

1 participant