Skip to content

devcloud tests: stop SupervisorTest's services at teardown instead of orphaning them - #318

Merged
SSFSKIM merged 2 commits into
mainfrom
fix/devcloud-supervisor-test-leak
Oct 21, 2026
Merged

SSFSKIM merged 2 commits into
mainfrom
fix/devcloud-supervisor-test-leak

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

SupervisorTest.tearDown SIGKILLed the supervisor. Every service the supervisor runs sits in a session of its own, so any test that ended with services still up left them running under launchd for good: the desired-list test's while :; do sleep 0.05; done loop and the env test's sleep 60. On the MacBook, 44 of those loops had piled up over three days and were spawning about 700 processes a second between them.

tearDown now:

  • takes a snapshot of the supervisor's children (each a session leader) with pgrep -P
  • SIGTERMs the supervisor, which stops each service group and waits (grace 3 s)
  • SIGKILLs the supervisor only if it hasn't exited within 10 s
  • kills the snapshotted groups, in case the supervisor couldn't stop them

Verified:

  • One test_services run on main left 2 orphans. With this change it leaves 0, and the devcloud/tests/unit suite passes.
  • I SIGSTOPped a supervisor running a service that ignores TERM. The old tearDown left the service running and the new one leaves nothing.

Sminos-Session: new-2a#bca9a36f (macbook on macbook)

… orphaning them

tearDown SIGKILLed the supervisor, and every service it runs sits in a
session of its own, so a test that ends with services up (the desired-list
test's `while :; do sleep 0.05; done` loop, the env test's `sleep 60`) left
them reparented to launchd for good. On the MacBook 44 such loops had piled
up over three days, spawning ~700 processes a second between them. tearDown
now SIGTERMs the supervisor, which stops each service group and waits, and
kills it only if it has not exited within 10 s.

Sminos-Session: new-2a#bca9a36f (macbook on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T07:16:27.656202Z c5356b2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…ad, in case it could not stop them

The SIGTERM path relies on the supervisor stopping its services; one that
hangs is SIGKILLed after 10 s, which orphans them again. tearDown now
snapshots the supervisor's children (each a session leader) before the
SIGTERM and kills their groups after it has exited. Checked with a
SIGSTOPped supervisor over a TERM-ignoring service: the old tearDown left
the service running, this one leaves nothing.

Sminos-Session: new-2a#bca9a36f (macbook on macbook)
@SSFSKIM
SSFSKIM merged commit 64eea04 into main Oct 21, 2026
6 checks passed
SSFSKIM added a commit that referenced this pull request Oct 21, 2026
…t stops its services' process groups)

Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
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.

1 participant