Skip to content

Test the stdio entry point (src/index.ts) in CI: disconnect, EPIPE, shutdown #295

Closed

Description

@TMHSDigital

Summary

src/index.ts has 0% coverage in CI. Every MCP test uses InMemoryTransport; the only test that starts dist/index.js over stdio is in the local-only localCapture.test.ts.

Where

  • src/index.ts:56-69, 73-87, 91-119
  • src/tests/localCapture.test.ts:468 (only stdio test, gated by RUN_LOCAL_CAPTURE_TESTS)

Details

The handlers for stdin EOF (#76), EPIPE (#229), uncaughtException (#207) and edit-job cancellation on shutdown (#237) have no CI regression signal.

Impact

If one breaks, a client that disconnects mid-recording can leave ffmpeg recording the screen, and CI stays green.

Suggested fix

Add a CI-safe test after npm run build (runs on Linux too):

Acceptance criteria

  • The checklist cases run in CI
  • src/index.ts shows non-zero coverage (via NODE_V8_COVERAGE on the child) or the cases are documented as process-level

Getting started

  • Relevant files: src/index.ts, src/__tests__/localCapture.test.ts
  • How to run tests: npm run build && npm test (also npm run typecheck and npm run lint)
  • Related docs: CONTRIBUTING.md, AGENTS.md

Filed by repo-audit/full-audit at f2fda28. Severity: medium. Effort: S-M. audit-key: testing|src/index.ts|shutdown

Activity

  1. added
    testing
    on Nov 9, 2026
  2. TMHSDigital commented on Nov 10, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in 6afd72b. src/__tests__/integration/entryStdio.test.ts runs dist/index.js over raw stdio on every CI leg (CI builds first). It checks two things:

    • tools/list returns exactly the tools in mcp-tools.json, except the app-only player tool. Closing stdin then exits with code 0 within 5 s, with no "Uncaught" or "Unhandled" on stderr.
    • If the client disconnects during a compress of a 120 s lavfi fixture, the server exits 0, reports "cancelled 1 edit job", and leaves no .partial file.

    The Windows case where the client disconnects mid-recording (#76) is in captureSmoke.test.ts, added with #300. src/index.ts runs in the child process, so these are documented as process-level checks rather than adding line coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumtesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions