sqlmesh icon indicating copy to clipboard operation
sqlmesh copied to clipboard

CI Fix - tests/core/test_plan.py::test_disable_restatement -- UTC Boundary

Open cmgoffena13 opened this issue 3 months ago • 1 comments

AI Notes

Failed test tests/core/test_plan.py::test_disable_restatement

What's Wrong

  • Assert compares plan.restatements end to to_date("tomorrow") with no pinned clock.
  • Plan build uses now() for restatement end; assertion resolves "tomorrow" again later.
  • Windows fast-test ran ~7+ min and crossed midnight UTC between those two calls.
  • End timestamps differ by exactly 1 day (1787443200000 vs 1787529600000).
  • Not Windows-specific — any long run near UTC midnight can flake.

Possible Fix Pin the test: @time_machine.travel("2026-08-22 15:00:00 UTC") on test_disable_restatement. Or stop using relative dates in the assertion — use fixed timestamps from the built plan, e.g. plan.restatements[snapshot.snapshot_id] directly, or explicit execution_time / start / end on PlanBuilder. time_machine is fine here — unit test, no cloud JWT auth.

cmgoffena13 avatar Aug 23 '26 00:08 cmgoffena13

Hi, I'd like to work on this. I'll submit a PR shortly.

nightcityblade avatar Aug 24 '26 03:08 nightcityblade