|
9 | 9 | import shutil |
10 | 10 | import tempfile |
11 | 11 | from dataclasses import dataclass |
| 12 | +from datetime import datetime, timezone |
12 | 13 | from pathlib import Path |
13 | 14 |
|
14 | 15 | import pytest |
@@ -1455,7 +1456,13 @@ def test_quota_cli_keeps_goal_boundary_authority_on_explicit_cold_path( |
1455 | 1456 |
|
1456 | 1457 | def test_quota_cli_deprecated_scheduler_detail_flag_matches_canonical_selector( |
1457 | 1458 | tmp_path: Path, |
| 1459 | + monkeypatch: pytest.MonkeyPatch, |
1458 | 1460 | ) -> None: |
| 1461 | + # Compare selectors at the same observation instant, including freshness. |
| 1462 | + monkeypatch.setattr( |
| 1463 | + "loopx.control_plane.runtime.time.now_utc", |
| 1464 | + lambda: datetime(2026, 1, 2, tzinfo=timezone.utc), |
| 1465 | + ) |
1459 | 1466 | with _stable_budget_fixture_root( |
1460 | 1467 | tmp_path / "quota-detail-alias-scheduler" |
1461 | 1468 | ) as stable_root: |
@@ -1488,7 +1495,13 @@ def test_quota_cli_deprecated_scheduler_detail_flag_matches_canonical_selector( |
1488 | 1495 |
|
1489 | 1496 | def test_quota_cli_all_detail_matches_repeated_canonical_selectors( |
1490 | 1497 | tmp_path: Path, |
| 1498 | + monkeypatch: pytest.MonkeyPatch, |
1491 | 1499 | ) -> None: |
| 1500 | + # Compare selectors at the same observation instant, including freshness. |
| 1501 | + monkeypatch.setattr( |
| 1502 | + "loopx.control_plane.runtime.time.now_utc", |
| 1503 | + lambda: datetime(2026, 1, 2, tzinfo=timezone.utc), |
| 1504 | + ) |
1492 | 1505 | with _stable_budget_fixture_root(tmp_path / "quota-detail-all") as stable_root: |
1493 | 1506 | project, runtime, registry_path, state_file = _write_fixture( |
1494 | 1507 | stable_root, |
|
0 commit comments