openai / openai/codex-plugin-cc

Test suite leaks ~50 app-server-broker processes per full run

Open
#629 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
33.3k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Summary

Running the full test suite on pristine main leaks roughly 50 app-server-broker processes per run (plus their fake codex app-server children). The processes survive test completion indefinitely; a development machine that ran the suite repeatedly over one afternoon accumulated 200+ leaked broker processes.

Reproduction

  1. Fresh checkout of main, npm install.
  2. Baseline: pgrep -fl app-server-broker | wc -l.
  3. npm test (all tests pass).
  4. Count again: ~50 new app-server-broker processes, each holding a unix socket under a cxc-* temp session dir, with fake codex app-server children from the test fixtures.

A control run confirmed the leak comes from tests that spawn a shared broker (any test path calling ensureBrokerSession via review/task against the fake codex) and finish without a SessionEnd/broker/shutdown, so nothing ever retires the broker. Tests that explicitly exercise SessionEnd teardown do clean up after themselves.

Impact

  • Every full-suite run permanently leaks ~50 processes and their temp session dirs until the machine is rebooted or they are killed manually.
  • CI and developer machines accumulate unbounded broker processes; local port/socket and process-table clutter can eventually cause unrelated test flakiness.

Suggested fix shape

A shared after/teardown helper in the test harness that, per temp workspace, sends broker/shutdown to any loadBrokerSession endpoint and kills the recorded pid — or a fixture-level registry of spawned brokers reaped at process exit.

Provenance

Surfaced while reproducing #612 on pristine main; the leak exists independently of that bug and of PR #623 (whose own new tests tear their brokers down).

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by running npm test and tracing test paths that call ensureBrokerSession, then inspect the test harness around loadBrokerSession and broker/shutdown. Confirm which spawned broker pids and temporary workspaces need cleanup. Done means the full suite still passes without leaving app-server-broker or fake codex processes behind.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.