test(atlasbot): make claim cleanup clock deterministic

This commit is contained in:
jenkins 2026-05-16 17:57:28 -03:00
parent 4bd8d07bf1
commit 7ef19f0619

View File

@ -430,6 +430,7 @@ def test_state_store_roundtrip_and_cleanup(tmp_path: Path, monkeypatch: pytest.M
path = tmp_path / "state.db"
store = ClaimStore(str(path), 60)
monkeypatch.setattr("atlasbot.state.store.time.monotonic", lambda: 1_000_000.0)
store.set(
"conv",
{
@ -442,7 +443,7 @@ def test_state_store_roundtrip_and_cleanup(tmp_path: Path, monkeypatch: pytest.M
assert payload and payload["snapshot_id"] == "snap-1"
assert payload["claims"] == [{"id": "c1"}]
assert _safe_json("{broken", []) == []
monkeypatch.setattr("atlasbot.state.store.time.monotonic", lambda: 1_000_000.0)
monkeypatch.setattr("atlasbot.state.store.time.monotonic", lambda: 1_000_120.0)
store.cleanup()
assert store.get("conv") is None