Skip to content

Commit 08554b6

Browse files
authored
test(quota): compare detail selectors at one observation instant (#6814)
1 parent e32e14e commit 08554b6

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎tests/control_plane/test_cli_output_budget.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import shutil
1010
import tempfile
1111
from dataclasses import dataclass
12+
from datetime import datetime, timezone
1213
from pathlib import Path
1314

1415
import pytest
@@ -1455,7 +1456,13 @@ def test_quota_cli_keeps_goal_boundary_authority_on_explicit_cold_path(
14551456

14561457
def test_quota_cli_deprecated_scheduler_detail_flag_matches_canonical_selector(
14571458
tmp_path: Path,
1459+
monkeypatch: pytest.MonkeyPatch,
14581460
) -> 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+
)
14591466
with _stable_budget_fixture_root(
14601467
tmp_path / "quota-detail-alias-scheduler"
14611468
) as stable_root:
@@ -1488,7 +1495,13 @@ def test_quota_cli_deprecated_scheduler_detail_flag_matches_canonical_selector(
14881495

14891496
def test_quota_cli_all_detail_matches_repeated_canonical_selectors(
14901497
tmp_path: Path,
1498+
monkeypatch: pytest.MonkeyPatch,
14911499
) -> 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+
)
14921505
with _stable_budget_fixture_root(tmp_path / "quota-detail-all") as stable_root:
14931506
project, runtime, registry_path, state_file = _write_fixture(
14941507
stable_root,

0 commit comments

Comments
 (0)