aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_cli_dispatch.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/tests/test_cli_dispatch.py')
-rw-r--r--packages/meshbay-node/tests/test_cli_dispatch.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/meshbay-node/tests/test_cli_dispatch.py b/packages/meshbay-node/tests/test_cli_dispatch.py
index b676546..c774dc0 100644
--- a/packages/meshbay-node/tests/test_cli_dispatch.py
+++ b/packages/meshbay-node/tests/test_cli_dispatch.py
@@ -150,12 +150,20 @@ def test_lifecycle_commands_delegate_to_systemctl_user(
`reload` and `restart-daemon` must ask systemd to do it, not hunt a PID
with pgrep and signal it directly — that pattern-matched a developer's own
running node by accident once, which is why it was replaced.
+
+ They must also reload the user manager's view of unit files first: a
+ package upgrade only reloads the *system* manager (it runs as root and
+ cannot reach a signed-in user's own), so the user manager can still be
+ holding a stale unit when one of these runs.
"""
monkeypatch.setattr(sys, "argv", ["meshbay-node", *argv])
daemon_mod.main()
systemctl_calls = dict(stub_daemon)["_systemctl_calls"]
- assert systemctl_calls == [["systemctl", "--user", verb, "meshbay-node"]]
+ assert systemctl_calls == [
+ ["systemctl", "--user", "daemon-reload"],
+ ["systemctl", "--user", verb, "meshbay-node"],
+ ]
assert not capsys.readouterr().err