tests: the headless forecast check fails since 2026-10-16 because the panel reads the real clock #11

Closed
opened 2026-10-17 09:18:26 +02:00 by schmidt.florian · 3 comments
Owner

HeadlessTests.ViewsRenderAndInteractionsApplySettingsAndPopupActions fails on master (adb8f5b) since 2026-10-16 08:33 UTC, on Windows and on Arch Linux. The other 320 tests pass.

Cause: FakeData.ForecastModel fixes now at 2026-10-15 16:45 UTC, but PanelWindow.RenderModel takes DateTimeOffset.UtcNow (src/FinalToken.App/PanelWindow.cs:86). The fixture's secondary window may forecast from 2026-10-16 08:33 UTC. Once the real clock passes that time, Display.ForecastWaiting correctly returns null, and HeadlessTests.cs:156 finds no "Forecast from" note. The app is right; the test depends on the date. Charts.cs:153 and Display.Projection also read the system clock, so more checks will expire, for example after the fixture's 2026-10-22 reset.

Plan:

  • Give PanelWindow a TimeProvider, TimeProvider.System by default, and use it everywhere the panel takes "now", including charts and forecast labels.
  • Pin the headless tests to the fixture time with a fixed clock.
  • Add a regression test: the same fixture shows the "Forecast from" note before the forecast start and hides it after, whatever the real date.
  • Find other tests that compare fixed dates with the real clock, and pin them the same way.
  • Build, all tests and the docs check pass.
`HeadlessTests.ViewsRenderAndInteractionsApplySettingsAndPopupActions` fails on `master` (adb8f5b) since 2026-10-16 08:33 UTC, on Windows and on Arch Linux. The other 320 tests pass. Cause: `FakeData.ForecastModel` fixes now at 2026-10-15 16:45 UTC, but `PanelWindow.RenderModel` takes `DateTimeOffset.UtcNow` (`src/FinalToken.App/PanelWindow.cs:86`). The fixture's secondary window may forecast from 2026-10-16 08:33 UTC. Once the real clock passes that time, `Display.ForecastWaiting` correctly returns null, and `HeadlessTests.cs:156` finds no "Forecast from" note. The app is right; the test depends on the date. `Charts.cs:153` and `Display.Projection` also read the system clock, so more checks will expire, for example after the fixture's 2026-10-22 reset. Plan: - [x] Give `PanelWindow` a `TimeProvider`, `TimeProvider.System` by default, and use it everywhere the panel takes "now", including charts and forecast labels. - [x] Pin the headless tests to the fixture time with a fixed clock. - [x] Add a regression test: the same fixture shows the "Forecast from" note before the forecast start and hides it after, whatever the real date. - [x] Find other tests that compare fixed dates with the real clock, and pin them the same way. - [x] Build, all tests and the docs check pass.
schmidt.florian self-assigned this 2026-10-17 09:18:26 +02:00
Author
Owner

Claim: developer schmidt.florian.

  • Coordinator: claude-opus-5-5.
  • Worker W11: Codex gpt-6.1-sol, high effort, Standard tier, a delegated T3 task (ft11-clock).

Branch 11-panel-clock, worktree FinalToken-wt/11-panel-clock, from master adb8f5b. The worker follows the plan above and leaves changes uncommitted; the coordinator commits, pushes and opens the PR.

**Claim**: developer schmidt.florian. - Coordinator: `claude-opus-5-5`. - Worker W11: Codex `gpt-6.1-sol`, high effort, Standard tier, a delegated T3 task (`ft11-clock`). Branch `11-panel-clock`, worktree `FinalToken-wt/11-panel-clock`, from `master` adb8f5b. The worker follows the plan above and leaves changes uncommitted; the coordinator commits, pushes and opens the PR.
Author
Owner

Worker W11 finished; its changes are committed as 312db4e and 0549e86 on 11-panel-clock. PR #12 is open. On 0549e86, the build has 0 warnings and all 321 tests pass on Windows 11 and in the Arch container. A fresh Codex gpt-6.1-sol reviewer (high effort) is reviewing it per docs/agents/review.md.

Worker W11 finished; its changes are committed as `312db4e` and `0549e86` on `11-panel-clock`. PR [#12](https://git.finalfactory.de/FinalFactory/FinalToken/pulls/12) is open. On `0549e86`, the build has 0 warnings and all 321 tests pass on Windows 11 and in the Arch container. A fresh Codex `gpt-6.1-sol` reviewer (high effort) is reviewing it per `docs/agents/review.md`.
Author
Owner

Done. PR #12 passed its first agent review with no findings and is squash-merged as d5ad3ec. The branch 11-panel-clock and its worktree FinalToken-wt/11-panel-clock are removed. No agent works on this issue now.

Done. PR [#12](https://git.finalfactory.de/FinalFactory/FinalToken/pulls/12) passed its first agent review with no findings and is squash-merged as `d5ad3ec`. The branch `11-panel-clock` and its worktree `FinalToken-wt/11-panel-clock` are removed. No agent works on this issue now.
Sign in to join this conversation.