Skip to content

The agent that grows with you

test(local-runtime): racing-callers fake publishes a modern state record

teknium1379f14b55366
diff --git a/tests/hermes_cli/test_local_runtime.py b/tests/hermes_cli/test_local_runtime.py
index 7a966a9ab10..7518b0b98ed 100644
--- a/tests/hermes_cli/test_local_runtime.py
+++ b/tests/hermes_cli/test_local_runtime.py
@@ -915,11 +915,10 @@ def test_ensure_local_runtime_serializes_racing_callers(tmp_path, monkeypatch):
def start(self, timeout_s=120):
spawns.append(1)
_time.sleep(0.3) # widen the window the other caller races into
- path = sup_mod.state_path()
- path.parent.mkdir(parents=True, exist_ok=True)
- path.write_text(json.dumps({
- "base_url": self.base_url, "api_key": self.api_key, "pid": os.getpid(),
- }), encoding="utf-8")
+ # A bare legacy ``{pid}`` record is no longer adoptable (a live PID is not evidence);
+ # publish what a real router publishes so the second caller can adopt it.
+ _write_current_process_state(
+ sup_mod.state_path(), base_url=self.base_url, api_key=self.api_key)
monkeypatch.setattr(sup_mod, "LlamaServerSupervisor", _FakeSupervisor)