Dependency publication now recovers interrupted config/facts changes before activation and leases live generations during collection. Receipts retain update correlation and failed steps across nested command boundaries. Doctor and desktop surfaces report those failures through shared owners. Move checkout updates out of the desktop facade. Stage a detached Windows relaunch waiter before shutdown, with bounded handshake and process-birth checks. Keep packaged lifecycle tests isolated from the installed app. Native verification exposed two production races: cron maintenance imported the interactive CLI and rewrote TERMINAL_CWD, and install-ID reads collided with first publication. Use the existing owners and locks. Plugin checks now run at startup and each due-gated housekeeping tick, not after 60 ticks. Share updater-test mutation boundaries and remove collection-root fixtures. Separate cold MCP startup from command latency and give the real HTTP drip test enough time to reach body handling. Root npm check passed, including packaging. The fixed-tree Windows Python run reported 44557 passed, one failed, and 1404 skipped, plus one retry-only HTTP test. Those final failures now pass in a 35-test bounded batch. A real isolated gateway wrote startup and periodic plugin-check receipts. Full final-tree CI, bundled Sandbox deployment, and actual App Installer relaunch remain unverified. docs/pm-audit-status.md records these limits.
33 lines
966 B
Python
33 lines
966 B
Python
"""Plugin checks are due-gated from startup, not delayed for an hour."""
|
|
|
|
import threading
|
|
|
|
from gateway import run
|
|
from hermes_cli import plugins_cadence
|
|
|
|
|
|
def test_plugin_cadence_runs_at_startup_and_each_housekeeping_tick(monkeypatch):
|
|
stop = threading.Event()
|
|
calls = []
|
|
|
|
def check(**kwargs):
|
|
calls.append(kwargs)
|
|
if len(calls) == 2:
|
|
stop.set()
|
|
|
|
# Stop an unfixed loop after its second sleep, without waiting for tick 60.
|
|
sleeps = []
|
|
|
|
def wait(timeout=None):
|
|
sleeps.append(timeout)
|
|
if len(sleeps) == 2:
|
|
stop.set()
|
|
return stop.is_set()
|
|
|
|
monkeypatch.setattr(stop, "wait", wait)
|
|
monkeypatch.setattr(plugins_cadence, "maybe_run_gateway_check", check)
|
|
monkeypatch.setattr(run, "_housekeeping_deferred_fts_retry", lambda: None)
|
|
monkeypatch.setattr(run, "_housekeeping_memory_trim", lambda: None)
|
|
run._start_gateway_housekeeping(stop)
|
|
assert len(calls) == 2
|