Skip to content

Drive the quit sweep over all four child registries - #163

Merged
juanmaguitar merged 1 commit into
trunkfrom
juanmaguitar/issue-160-quit-sweep
Aug 7, 2026
Merged

juanmaguitar merged 1 commit into
trunkfrom
juanmaguitar/issue-160-quit-sweep

Conversation

@juanmaguitar

Copy link
Copy Markdown
Collaborator

Closes #160.

The quit sweep ends children from four registries and routes each through the tree kill (#83). Its test only started an install, so the other three registries were empty and the lines sweeping them contributed nothing to the assertion — the test could not tell the difference between that code being present and being deleted.

It now starts an install, a script, a per-site Playground server and the shared web server, quits once, and asserts the tree kill received every child exactly once and that the direct kill received none. The assertion is order-independent, so it does not fossilise the order of the registries in the sweep.

Test-only; the sweep itself was already correct.

Mutations killed

Verified by applying each mutation to the sweep and confirming the test goes red, and that it is green on trunk:

  • deleting the scripts spread
  • deleting the Playground servers spread
  • deleting the web server entry
  • swapping the tree kill for a direct kill

Worth naming the asymmetry this closes: stopping a server from the UI was wired through the tested modules and covered in #146, but quitting is a different path, so a contributor who closes the window rather than pressing stop was in the gap.

Review

.github/instructions/code-review.instructions.md run against the branch: 1 finding, fixed here — the first version asserted the children in a fixed order, which would have failed for a harmless reordering of the sweep.

npm test and npm run test:electron both 219/219, lint clean.

The 'quitting sweeps running children through kill-tree' test only started
an npm:install, so runningScripts, playgroundServers and playgroundWebServer
were empty when it quit — their spread lines in the before-quit sweep swept
nothing and deleting any of them kept the suite green.

Start a script, a per-site Playground server and the shared web server as
well as an install, quit once, and assert kill-tree receives every child
exactly once and child.kill() none of them. Verified the test fails for the
right reason against each of the four mutations the issue names: deleting the
runningScripts, playgroundServers or playgroundWebServer spread, and swapping
killChildTree(child) for child.kill().

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@juanmaguitar
juanmaguitar force-pushed the juanmaguitar/issue-160-quit-sweep branch from a4211c6 to b7799cd Compare August 7, 2026 06:21
@juanmaguitar
juanmaguitar merged commit 50ad89d into trunk Aug 7, 2026
@juanmaguitar
juanmaguitar deleted the juanmaguitar/issue-160-quit-sweep branch August 7, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quitting only proves it sweeps installs, not the Playground servers

1 participant