Skip to content

test: graceful shutdown for mcp e2e tests to enable coverage#27

Merged
sonesuke merged 1 commit intomainfrom
feature/improve-mcp-coverage
Feb 21, 2026
Merged

test: graceful shutdown for mcp e2e tests to enable coverage#27
sonesuke merged 1 commit intomainfrom
feature/improve-mcp-coverage

Conversation

@sonesuke
Copy link
Copy Markdown
Owner

Description

MCP E2E tests were spawning the arxiv-cli mcp process and terminating it with child.kill() (SIGKILL). This prevented .profraw coverage data from being flushed, resulting in 0% coverage for src/mcp/mod.rs.

Changes

  • Replaced child.kill() with graceful_shutdown() that:
    1. Drops stdin to signal the MCP server to exit normally
    2. Polls try_wait() for up to 5 seconds for clean exit
    3. Falls back to kill() only if the process doesn't exit

Results

Using cargo llvm-cov show-env + cargo test + cargo llvm-cov report:

  • src/mcp/mod.rs: 0% → 56.14%
  • Total coverage: 81.69% → 85.15%

@sonesuke sonesuke merged commit aa41f2a into main Feb 21, 2026
4 checks passed
@sonesuke sonesuke deleted the feature/improve-mcp-coverage branch February 21, 2026 08:04
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.

2 participants