Skip to content

fix(test): stop ProcessTreeProbe from leaking orphaned fake-codex processes#98

Merged
chihsuan merged 1 commit into
mainfrom
fix/process-tree-probe-leak
May 27, 2026
Merged

fix(test): stop ProcessTreeProbe from leaking orphaned fake-codex processes#98
chihsuan merged 1 commit into
mainfrom
fix/process-tree-probe-leak

Conversation

@chihsuan
Copy link
Copy Markdown
Member

Context

The turn-timeout side-output test used a ProcessTreeProbe double that recorded the cleanup call but never ran it, so each test run orphaned a fake-codex busy loop that pinned a CPU core indefinitely.

TL;DR

Make the test's process-tree cleanup double actually terminate the spawned process tree instead of no-op'ing it.

Summary

  • ProcessTreeProbe.terminate_port_descendants/1 now delegates to the real SymphonyElixir.ProcessTree after sending its verification message.
  • Stops the bash -> /bin/sh fake-codex busy loop (while true; sleep 0.01) from leaking as an orphan on every run of the turn-timeout side-output test.
  • Keeps the existing {:process_tree_cleanup, true} assertion intact; only the dropped side effect is restored.

Alternatives

  • Add an on_exit sweep to kill stray fake-codex processes: treats the symptom, not the missing cleanup in the double.
  • Slow the fake-codex loop (sleep 0.5): reduces but does not remove the leak.

Test Plan

  • make all
  • mix test test/symphony_elixir/app_server_test.exs:1864 then pgrep -fl symphony-elixir-app-server-turn-timeout returns no orphaned processes

@chihsuan chihsuan merged commit e617bc4 into main May 27, 2026
11 checks passed
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