Skip to content

bug(test): the extension suite loads a real launchd job on every Mac — a fleet-scripts test reaches /bin/launchctl and leaves a respawning 'ssh hq' agent #1783

Closed

Description

@jeonghun-jj-lee

Important

Problem — The extension fast suite loads a real launchd job on every Mac it runs on. A test in the fleet-scripts projection suite runs the fleet installer in install mode on Darwin with no stub for launchctl. The installer then calls the real /bin/launchctl and loads a fabricated co.harmoniqs.amico-tunnel agent from the test's temp dir: KeepAlive + RunAtLoad, running /usr/bin/ssh hq. Its temp dir is deleted afterwards, but the job stays loaded and launchd keeps respawning it. Observed on JJ's laptop 2026-10-12: launchctl print gui/<uid>/co.harmoniqs.amico-tunnel → path /private/var/folders/…/T/fleet-scripts-Un0vh2/Library/LaunchAgents/co.harmoniqs.amico-tunnel.plist, program /usr/bin/ssh hq, runs = 80, last exit 255, state "spawn scheduled". The real amico-tunnel label belongs to the fleet's hub link, so a stray job under that label can also mislead the healthcheck and the installer's own --check.
Approach — Tests must never reach the real service manager: the installer gets a seam for the launchctl binary and the LaunchAgents dir, and the suite runs every installer invocation against recording stubs with a PATH backstop the tests assert is never hit. Fixed on #1775's branch (commit edfa917), landing with the #1770 integration PR (#1781).

Acceptance Criteria

  • No extension test invokes the real launchctl or systemctl — a PATH backstop records any call that bypasses the seam, and a test asserts the backstop was never reached.
  • After a full extension fast-suite run on macOS, launchctl list shows no job whose plist lives under a temp directory.

Notes

Activity

  1. added
    bugSomething isn't working
    hitlNeeds human review before merge
    on Oct 13, 2026
  2. added a commit that references this issue on Oct 13, 2026
    3a6be6a
  3. jeonghun-jj-lee commented on Oct 13, 2026

    @jeonghun-jj-lee
    ContributorAuthor

    Root cause fixed on the #1770 integration branch (3a6be6a, PR #1781): installer seam + recording launchctl stub + an asserted PATH backstop. Verified by the director: the integrated suite at 8965094 no longer re-registers the stray job (its plist path stayed fixed across a full run). Note: running the full suite on any branch WITHOUT that fix (including old main) still re-loads it from a new temp dir — observed once during this campaign. The one-time cleanup in the body is still needed on each Mac that ran the suite. Leaving this open until #1781 merges to main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workinghitlNeeds human review before merge

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions