Skip to content

test(server): let fake Claude CLIs exit when stdin closes - #494

Merged
incognitojam merged 1 commit into
mainfrom
fix/server-test-fake-claude-exit
Sep 26, 2026
Merged

incognitojam merged 1 commit into
mainfrom
fix/server-test-fake-claude-exit

Conversation

@incognitojam

Copy link
Copy Markdown
Owner

Every run of the Claude capability probe test and the provider instance registry test left two fake claude processes running. The processes were reparented to the service manager and kept running for days after their temp directories were deleted. One machine had accumulated eleven of them.

Both fake CLIs ended with setInterval(() => {}, 1_000), which kept them alive after the SDK closed their stdin. The SDK's fallback SIGTERM runs on a timer and when the process exits, and neither fired because the test worker had already finished.

The interval is removed. The open stdin keeps each fake running for as long as the test needs it, and the fake exits when stdin closes, as the real CLI does when idle.

Validation

  • Before: one run of the two test files took the number of leftover fake processes from 11 to 13.
  • After: four runs, with all 8 tests passing each time, and no new leftover processes.

The fake peers in serviceLauncher.test.ts use the same interval, but the launcher terminates them explicitly and none were among the leftovers, so they are unchanged.


Written by an agent (Claude Code, claude-opus-5-5).

The fake Claude CLIs in the capability probe and provider instance registry
tests ended with an empty setInterval, which kept them running after the
SDK closed their stdin. The SDK's fallback SIGTERM never ran either, because
the test worker had finished by then. Every run of these tests left two
processes behind, reparented to the service manager.

Remove the interval. The open stdin keeps each fake running for as long as
the test needs it, and the fake exits when stdin closes, as the real CLI
does when idle.
@incognitojam
incognitojam merged commit 8cf162a into main Sep 26, 2026
17 checks passed
@incognitojam
incognitojam deleted the fix/server-test-fake-claude-exit branch September 26, 2026 14:46
incognitojam pushed a commit that referenced this pull request Oct 11, 2026
)

Signed-off-by: Yordis Prieto <[email protected]>

Fork adaptation: Fork #494 had already removed this fake CLI's unconditional interval so it exits when stdin closes. This takes upstream's interval that is cleared when stdin closes in its place.

(cherry picked from commit 6414268)
Upstream-PR: 14926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant