Skip to content

Time-zone-dependent tests are skipped or vacuous on the UTC CI runner #119

Closed

Description

@CaffeinatedCoder

Two tests check that no time-zone rule is consulted for a wall clock the machine's zone skips or repeats, and neither can do so on the CI runner. .github/workflows/dotnet.yml runs on ubuntu-latest, whose zone is UTC, and sets no TZ. Measured on main (7f4dc47):

TZ=UTC dotnet test test/CodoMetis.ValueRanges.EFCore.PostgreSQL.Tests --filter WrapperTimestampSet_LocalElement_KeepsAWallClockTheZoneSkips
   → skipped (Assert.Inconclusive: "UTC skips no wall clock in 2026.")
TZ=UTC dotnet test test/CodoMetis.ValueRanges.Tests --filter LocalValue_RoundTrips_WithItsKind
   → passed, but 2026-03-29 02:30 and 2026-10-25 02:30 are ordinary wall clocks in UTC, so the DST rows test nothing zone-specific
  • test/CodoMetis.ValueRanges.EFCore.PostgreSQL.Tests/SqlLiteralTests.cs — WrapperTimestampSet_LocalElement_KeepsAWallClockTheZoneSkips searches TimeZoneInfo.Local for an invalid time and goes Inconclusive when there is none.
  • test/CodoMetis.ValueRanges.Tests/TemporalLiteralGrammarTests.cs — LocalValue_RoundTrips_WithItsKind hard-codes Europe/Berlin transition instants.

So the promise in docs/serialization.md that a local value round-trips "with its kind" through a skipped or repeated wall clock is checked only on a developer machine in a DST zone. The workflow's own comment ("nothing in the four shipping packages reads the environment … no TimeZoneInfo") is true of src/, but the tests of the local-kind rule depend on the zone by construction, and under UTC they are vacuous.

Fix: run the unit job with TZ=Europe/Berlin (or add a second matrix leg), and turn the Inconclusive into a failure when the zone has no gap, so the test can't go quiet again. Alternatively construct the skipped wall clock with TimeZoneInfo.FindSystemTimeZoneById("Europe/Berlin") and DateTime.SpecifyKind instead of relying on Local.

Found in the 10.0.0 bug hunt (code-analyst reading, reproduced here). Tests only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/literalsParse, TryParse and formattingpackage/coreAffects CodoMetis.ValueRangespackage/efcoreAffects CodoMetis.ValueRanges.EFCore.PostgreSQLtestsAdds or changes tests only (oracles, harnesses); no library code

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions