The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(update): the killed-update lock test no longer races the receipt clock
Teknium96b3116d0f2e
diff --git a/tests/hermes_cli/test_gitlock.py b/tests/hermes_cli/test_gitlock.pyindex b27fdd6f3a5..abc059eccda 100644--- a/tests/hermes_cli/test_gitlock.py+++ b/tests/hermes_cli/test_gitlock.py@@ -20,6 +20,7 @@ import osimport shutilimport subprocessimport time+from datetime import datetime, timedeltafrom pathlib import Pathimport pytest@@ -454,6 +455,10 @@ def _killed_update_receipt() -> None:update_receipt.begin_update_receipt()current = update_receipt._current.get()current.data.update(pid=dead.pid, pid_create_time=None, writer_pid=dead.pid, writer_create_time=None)+ # A killed run started well before its git took the lock. Same-instant would be a coin flip: the+ # lock's mtime comes from the kernel's coarse clock, up to a tick BEHIND this precise started_at.+ started = datetime.fromisoformat(current.data["started_at"]) - timedelta(seconds=5)+ current.data["started_at"] = started.isoformat()payload = (json.dumps(current.data) + "\n").encode("utf-8")for stale in update_receipt._receipt_dir().glob(f"update_*_{current.data['update_id']}.json"):stale.unlink() # the run's own archive, as its dead process last wrote it