Skip to content

fix(roadmap): freeze clock in alternatives gauge test #7582

Done

Description

@dan-petty

Problem or Motivation

tests/roadmap/test_roadmap_alternatives.py::test_the_row_sends_the_gauges_for_a_round_with_every_check_current (tests/roadmap/test_roadmap_alternatives.py:3778) fails on main starting 2026-11-28 (CI Quality Gate run 46145570860 and local uv run devops ci test tests/roadmap/test_roadmap_alternatives.py: 1 failed, 197 passed).

The test calls _mark_checked(store, _item(store, "Checked"), days=0), which sets checked_at to NOW (datetime(2026, 10, 29, 12, 0, tzinfo=UTC) at tests/roadmap/test_roadmap_alternatives.py:95), and then calls _alternatives_row().runner(store=store, repo=REPO) without freezing the clock (@time_machine.travel(NOW, tick=False)). Because 2026-11-28 is 30 days after 2026-10-29, the runner sees the check as due for recheck (recheck_days=30), calls the model, and script.seen is non-empty instead of [].

Proposed Solution & Architectural Design

Decorate test_the_row_sends_the_gauges_for_a_round_with_every_check_current (and check any sibling gauge tests in tests/roadmap/test_roadmap_alternatives.py:3758-3805 that use _mark_checked with NOW) with @time_machine.travel(NOW, tick=False).

Acceptance Criteria

  • uv run devops ci test tests/roadmap/test_roadmap_alternatives.py passes with real wall-clock time at or after 2026-11-28.

Proposed design

Problem statement

The alternatives gauge test marks a check at NOW and then runs the row without a frozen clock. On a wall-clock date at or after 2026-11-28, the check is 30 days old. The runner calls the model, so script.seen is not empty. The fix freezes the clock at NOW for the gauge test and each sibling gauge test in the same block that uses the same pattern.

Acceptance criteria

Requirement: Freeze the gauge tests

The gauge test at tests/roadmap/test_roadmap_alternatives.py:3778 and each sibling gauge test in 3758-3805 that calls _mark_checked with NOW MUST run with the clock frozen at NOW.

Scenario: The alternatives gauge tests run

  • WHEN uv run devops ci test tests/roadmap/test_roadmap_alternatives.py runs.
  • THEN The command passes and reports no failed test.

Requirement: Pending a person after the merge

The alternatives test module MUST pass on main with the real wall clock at or after 2026-11-28.

Scenario: The Quality Gate runs after the recheck window

  • WHEN The CI Quality Gate runs on main at or after 2026-11-28.
  • THEN uv run devops ci test tests/roadmap/test_roadmap_alternatives.py passes and reports no failed test.

Existing Tool Considered

No alternatives check has run. The open, maintained time-machine library covers the need to freeze the clock at NOW: tests/roadmap/test_roadmap_alternatives.py already imports time_machine and uses @time_machine.travel(NOW, tick=False) in other tests. The proposal reuses this library and adds no custom clock code. It lacks nothing for this test.

Key questions

  • How should the gauge test keep its check current?: Freeze the clock at NOW with @time_machine.travel(NOW, tick=False). (best practice) [sources: tests/roadmap/test_roadmap_alternatives.py:95, tests/roadmap/test_roadmap_alternatives.py:162, tests/roadmap/test_roadmap_alternatives.py:3778]
    • Chosen: Freeze the clock at NOW. _mark_checked(days=0) writes checked_at at NOW. The file already imports time_machine and uses this decorator.
    • Rejected: Change recheck_days in the test. This changes a product setting and hides the stale-check behavior.
    • Rejected: Use a relative check time. The NOW and _days_ago helpers already define the instant. A relative time adds code and no value.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    on Nov 28, 2026
  2. dan-petty commented on Nov 28, 2026

    @dan-petty
    OwnerAuthor
  3. added
    scope/roadmap
    status/new
    value/medium
    effort/low
    priority/p1-high
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 28, 2026
  4. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  5. added
    status/in-review
    and removed
    status/in-progress
    on Nov 28, 2026
  6. removed
    status/in-review
    owner/agent
    on Nov 28, 2026
  7. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-28 17:56 UTC

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

    effort/lowpriority/p1-highscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions