Skip to content

Live cxpak MCP transport (RmcpCxpakClient) has zero tests #8

Description

@lyubomir-bozhinov

Severity: Medium (test coverage of the highest-risk code)

Problem

The live cxpak transport RmcpCxpakClient (src/cxpak.rs, ~lines 245-484) has no tests. Existing tests cover only RecordedClient, is_indexing, SpawnBackoff, and DTO defaults — shape checks. Untested: child-process spawn, the 15s handshake timeout, the 10s call timeout, index-warm polling, Arc-identity connection eviction, kill_child, and Drop teardown. Comments reference a #[tokio::test] teardown that does not exist.

Why it matters

This is the most failure-prone code in a crate other components depend on — process spawning and timeout/eviction logic — and it is entirely unverified. Regressions here surface as hangs or leaked child processes in every consumer.

Proposed fix

Add a fake-child / stub-server harness to exercise timeout, eviction, backoff, and teardown paths; add #[ignore] live smoke tests against a real cxpak binary for the happy path.

Acceptance criteria

  • Timeout, connection-eviction, and Drop/kill_child paths have deterministic tests.
  • A leaked-child assertion exists (no orphaned process after Drop).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions