Skip to content

fix(tests): freeze clock in stage snapshot test #7184

Not planned

Description

@dan-petty

Problem Description

tests/roadmap/stage/test_roadmap_stage_github_snapshot.py::test_agent_phase_offers_stock_tools_only_without_read_issue_or_find_issues fails after 2026-11-25T11:30:00Z on origin/main and on every pull request in CI (Tests & Coverage (shard 1 of 5)).

The module defines a fixed timestamp NOW = datetime(2026, 11, 25, 9, 0, tzinfo=UTC) (tests/roadmap/stage/test_roadmap_stage_github_snapshot.py:47). _prepare() passes now=NOW to prepare_stage_job, which writes deadline = NOW + 9000s (2026-11-25T11:30:00Z, DEFAULT_ROADMAP_STAGE_TIME_BUDGET_SECONDS in src/devops_cli/config/defaults.py:1054). The test then invokes run_stage_agent(folders, model=script.model()) without freezing time; run_stage_agent computes (inputs.deadline - datetime.now(UTC)).total_seconds() (src/devops_cli/roadmap/stage/stage_job_phases.py:722), gets 0, and ends before invoking the scripted model (script.tools_offered == []).

Reproduction Steps

  1. Check out origin/main at 0b9c6983f after 2026-11-25T11:30:00Z.
  2. Run .venv/bin/pytest -n 0 tests/roadmap/stage/test_roadmap_stage_github_snapshot.py.
  3. Observe test_agent_phase_offers_stock_tools_only_without_read_issue_or_find_issues fail at assert script.tools_offered == stock.tools_offered ([] == [['edit_file', 'grep', 'list_files', 'read_file', 'shell', 'write_file']]).

Expected vs Actual Behavior

Expected: The snapshot test runs with a frozen clock (@time_machine.travel(NOW, tick=False)) so the agent phase executes deterministically and script.tools_offered == stock.tools_offered passes at any wall-clock time.
Actual: After 2026-11-25T11:30:00Z, run_stage_agent sees an expired inputs.deadline against wall-clock datetime.now(UTC), skips the model call, and leaves script.tools_offered empty, failing Tests & Coverage (shard 1 of 5) in CI.

Environment Diagnostics

  • DevOps CLI Version: 0.219.0 (origin/main commit 0b9c6983f)
  • Python Version: 3.14.10
  • OS & Architecture: Linux devcontainer / GitHub Actions runner

Logs, Traces, or Terminal Output

FAILED tests/roadmap/stage/test_roadmap_stage_github_snapshot.py::test_agent_phase_offers_stock_tools_only_without_read_issue_or_find_issues
AssertionError: assert [] == [['edit_file', 'grep', 'list_files', 'read_file', 'shell', 'write_file']]

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Source

Source: #7179

Activity

  1. added
    type/bug
    source/agent
    status/new
    effort/low
    value/high
    scope/tests
    on Nov 25, 2026
  2. dan-petty commented on Nov 25, 2026

    @dan-petty
    OwnerAuthor
    • Priority: The test failure causes CI to fail on every pull request and on main.
    • Possible duplicate: fix(tests): freeze wall clock in stage agent snapshot test #7181, which may ask for the same change. The model names Freeze the wall clock with time_machine.travel(NOW) in test_agent_phase_offers_stock_tools_only_without_read_issue_or_find_issues so the agent phase executes deterministically at any wall-clock time. as the change that both ask for. Both items fix the same test in the same file by adding time_machine.travel to the agent phase call. A person closes one of the two if that is so.
  3. added
    priority/p0-critical
    on Nov 25, 2026
  4. dan-petty commented on Nov 25, 2026

    @dan-petty
    OwnerAuthor

    Closing as duplicate of #7181 (PR #7183 addresses the same wall-clock expiry in tests/roadmap/stage/test_roadmap_stage_github_snapshot.py::test_agent_phase_offers_stock_tools_only_without_read_issue_or_find_issues).

  5. removed
    status/new
    on Nov 25, 2026
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/p0-criticalscope/testssource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions