Summary
TestArrivalsAndDeparturesForStop_VehicleWithNilID in internal/restapi/arrivals_and_departures_for_stop_handler_test.go fails with no arrivals returned, causing the assertion:
should find arrival for test trip NilIDTrip
Root Cause
PR #744 introduced an in-memory cache for GetActiveServiceIDsForDate. Tests that insert their own calendar rows must call api.GtfsManager.MockClearServiceIDsCache() so the cache does not hold stale service IDs from an earlier test in the same package run.
This test inserts nilid_service via CreateCalendar but was missing that cache-clear call. When tests run in order (as in make test), nilid_service is never seen as active and the handler returns zero arrivals.
Fix
Add MockClearServiceIDsCache() after inserting the calendar entry — the same pattern already used in two other tests in this file.
How to verify
go test -tags "sqlite_fts5" -count=1 ./internal/restapi/...
Summary
TestArrivalsAndDeparturesForStop_VehicleWithNilIDininternal/restapi/arrivals_and_departures_for_stop_handler_test.gofails with no arrivals returned, causing the assertion:Root Cause
PR #744 introduced an in-memory cache for
GetActiveServiceIDsForDate. Tests that insert their own calendar rows must callapi.GtfsManager.MockClearServiceIDsCache()so the cache does not hold stale service IDs from an earlier test in the same package run.This test inserts
nilid_serviceviaCreateCalendarbut was missing that cache-clear call. When tests run in order (as inmake test),nilid_serviceis never seen as active and the handler returns zero arrivals.Fix
Add
MockClearServiceIDsCache()after inserting the calendar entry — the same pattern already used in two other tests in this file.How to verify