Exercise PR #2261's macOS daemon stop/start/restart paths on a real macOS host

Open
#2,268 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, macos
Domain
devops, testing-qa

Research direction

On a real macOS host with the daemon installed, run the five commands and scenarios in the issue, including the crash-loop throttle-gap case. Check the launchctl exit codes and report the launchd version; the acceptance criterion is that all five steps pass, or deviations are filed as daemon-stop bugs.

Written by the indexing model from the issue text.

Description

Source: #2261 at a1174334c96058bdfb57cd76ff86a93b3404934d (triage follow-up, not a review finding)

PR #2261 rewrote the macOS daemon stop path (launchctl bootout + bounded unload poll, preserved plist, supervision-gated stop, pid-proved start after a stop), but no macOS path in that PR has ever executed: the review environment had no macOS host, runDaemonStop keys off process.platform with no override, and the sandbox's mock launchctl is unreachable from a Linux run. Linux was exercised live end-to-end in scripts/sandbox/hyp-sandbox; macOS rests on launchd's documented exit codes, the adapter seam, and unit tests that drive those codes through our code (proving we read them correctly, not that launchd emits them).

The release checklist's manual macOS gate (hypaware status, daemon restart, daemon uninstall) does not cover daemon stop, so nothing currently forces this before a tag.

What to run on a real macOS host

With the daemon installed:

  1. hyp daemon stop - expect daemon: stopped, exit 0, and the daemon still down well past launchd's throttle (10s+). launchctl print gui/$UID/com.hyperparam.hypaware should exit 113; the plist stays in ~/Library/LaunchAgents.
  2. hyp status - expect overall: healthy with a warning naming the unloaded LaunchAgent and repair hyp daemon start (not degraded / "nothing is being captured", and not hyp daemon install).
  3. hyp daemon start - expect success with a real pid (this arm bootstraps and must survive the RunAtLoad kickstart race: launchd may answer kickstart with 3: No such process / Operation already in progress).
  4. hyp daemon stop then hyp daemon restart - expect a healthy daemon with a new pid.
  5. For the supervision gate (round 2 finding A): make the daemon crash-loop (e.g. break its config), then hyp daemon stop during the throttle gap while launchctl print shows the job held with no pid - expect a real stop, not daemon: not running followed by a respawn.

Specifically confirm launchd's answers match what the code assumes: bootout returning 36: Operation now in progress or 3: No such process on a successful stop, print exit 113 once unloaded, and a bootstrapped label's initial spawn possibly left pended (#1036 shape).

Known test-double gap (context, not a separate task)

The sandbox mock systemctl keeps active: true with a live pid and never models a supervised unit with no MainPID, so finding A's crash-loop window is pinned only at the systemdUnitStatus unit-test seam on either platform. The launchctl fakes were extended in the PR to express the pended-spawn and non-zero-bootout states.

Acceptance

The five steps above pass on a real macOS host (report the launchd version), or the deviations are filed as bugs against the daemon stop path.

Dominant language
JavaScript
Stars
11
Forks
0
Avg merge
2h 55m
Merged PRs (30d)
294

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hyparam/hypaware

All issues in hyparam/hypaware

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.