Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tests/unit/test_daemon_relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,16 @@ def test_connection_running_returns_base_url_and_bearer():
assert bearer == ensured["token"]


def test_connection_stopped_after_running_raises_again():
def test_connection_stopped_after_running_raises_again(monkeypatch):
# The fake manager reports a hardcoded pid but owns no real OS process, so
# its shutdown() can't make that pid disappear. registry.stop() verifies the
# pid is gone via psutil.pid_exists against the real process table, which
# flakes when the fake pid collides with a live process on the runner. Model
# the fake sidecar as fully terminated so the check reflects the double's
# intent, not the host's process table.
monkeypatch.setattr(
"gaia.daemon.sidecars.registry.psutil.pid_exists", lambda pid: False
)
reg = _toy_registry()
reg.ensure("toy")
reg.stop("toy")
Expand Down
Loading