fix(ci): two persistent CI failures — date-buckets timezone + Testcontainers Docker #476
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Two unrelated CI failures block every PR merge. Both are pre-existing (present on
mainsince at least run 1374) and are not caused by feature code.Failure 1 —
date-buckets.spec.ts(frontend, 2 tests)Affected tests (
src/lib/shared/utils/date-buckets.spec.ts):bucketByDay > returns "today" at exact midnight start of todaybucketByDay > returns "yesterday" for any time on the previous dayRoot cause:
startOfDay()indate-buckets.ts:12usesDate.setHours(0, 0, 0, 0), which sets midnight in the system's local timezone. The CI runner runs in UTC. Two test cases pass midnight Berlin-time dates (+02:00), which are 22:00 UTC the previous day:2026-04-22T00:00:00+02:00yesterdaytoday2026-04-21T00:00:00+02:00thisWeekyesterdayThe function logic is correct — it's the runner timezone that diverges from the test assumptions.
Fix: Add
TZ: Europe/Berlinto theenv:block of the frontend test CI step in the workflow YAML. One line, zero code changes.Failure 2 — Backend Unit Tests (234 errors)
Affected tests: All integration test classes that use Testcontainers (
PersonRepositoryTest,PersonServiceIntegrationTest,RelationshipServiceIntegrationTest,RenameUsersToAppUsersMigrationTest, …)Root cause: Testcontainers cannot find the Docker daemon in the CI runner container:
All 234 errors are a cascade: the first context load fails, then every subsequent test class is skipped with
ApplicationContext failure threshold (1) exceeded.The
OCR Service Testsjob (pure unit tests, no Testcontainers) passes every time, confirming the runner itself works — only Docker-in-Docker is missing.Fix: Configure the self-hosted runner to expose Docker to the job container. Two options:
privileged: trueon the job container so Testcontainers can spin up its own Docker daemon (DinD).Acceptance criteria
date-buckets.spec.tspasses in CI (both failing tests green)postgres:16-alpine)Implemented in PR #494 — branch
fix/issue-476-ci-failures.Commits:
42fda767—fix(ci): add TZ=Europe/Berlin to frontend test step1333e690—fix(ci): expose Docker socket env vars for Testcontainers in backend jobab7fe81b—ci: track act_runner config with Docker socket mountVerified locally:
TZ=UTC npx vitest run date-buckets.spec.ts→ 2 failures (confirms the bug)TZ=Europe/Berlin npx vitest run date-buckets.spec.ts→ 7/7 green (confirms the fix)The Testcontainers fix (
DOCKER_HOST+TESTCONTAINERS_RYUK_DISABLED) requires a CI run to verify. The runner-config.yaml with the Docker socket mount is now tracked in the repo.