Repository navigation
fix(npm): do not report signal-terminated subprocesses as successful - #3928
Youyuan Zhang (youyuan116) wants to merge 1 commit into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
Thank you for your contribution Youyuan Zhang (@youyuan116)! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
🟢 Approval recommended
The fix is focused, correctly preserves numeric exit codes, and has comprehensive cross-platform CI coverage.
0 open findings
What changed in this PR
Fixes npm launcher signal termination being incorrectly reported as success.
Changes:
- Maps signal-terminated subprocesses to exit code 1.
- Adds cross-platform regression tests and CI discovery.
- Adds Azure and Fabric changelog entries.
| File | Description |
|---|---|
eng/npm/platform/index.js |
Corrects signal exit handling. |
eng/npm/test/platform.test.js |
Adds launcher regression coverage. |
eng/pipelines/templates/jobs/analyze.yml |
Runs all npm tests across platforms. |
servers/Azure.Mcp.Server/changelog-entries/npm-fix-signal-exit-status.yaml |
Documents the Azure fix. |
servers/Fabric.Mcp.Server/changelog-entries/npm-fix-signal-exit-status.yaml |
Documents the Fabric fix. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@microsoft-github-policy-service agree |
|
Could a maintainer review this exit-status fix when convenient? The PR pipeline passed, and I have updated the description with verified Linux, macOS, and Windows test counts and direct CI log links. The six SIGTERM/SIGINT/SIGKILL regression cases ran and passed on both Linux and macOS. Thank you. |
What does this PR do?
Fix a false-success exit status in the shared npm platform launcher. When a subprocess is terminated by a signal, the child-process exit event supplies
code = null;resolve(code || 0)incorrectly converts that to success. Useresolve(code ?? 1)to preserve numeric exit codes, including zero, and return failure when no numeric status is available.Add 14 focused regression cases using the real launcher and local Node subprocesses, plus Azure/Fabric changelog entries. Include npm test discovery in the existing Windows/Linux/macOS analysis jobs so the new cases are executed in CI.
Pre-submission validation
9fbb8d4ce3b901d8eb4703be6e1a2b8c10277b66.git apply --checkandgit diff --checkpassed.Hosted CI verification (logs checked 2026-10-16)
Azure Pipelines build 6949712 completed successfully on 2026-10-13 for source commit
86d74b9b83d762f9cf9c136258f608768fe1c0ea. This was PR merge validation (refs/pull/3928/merge); the source SHA in the build metadata matches this branch. The hosted pipeline, including source analysis and platform build jobs, passed.Counts were read from the actual
Run npm launcher and wrapper testsTAP output, rather than inferred from the green job status. No npm tests were cancelled. All 29 currently reported GitHub checks, includinglicense/cla, passed.The six SIGTERM/SIGINT/SIGKILL regression cases (CLI and module paths) executed and passed on both Linux and macOS. Their only skipped test is Windows-specific LOCALAPPDATA behavior. The nine Windows skips cover POSIX signals and permission semantics.
GitHub issue number?
No tracking issue has been opened for this fix. This PR presents the reproduction, proposed change, and validation for maintainer review.
Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test PipelineMCP tool and Azure tool-specific checklist sections are not applicable: this changes shared npm launcher infrastructure, without adding tools, modifying descriptions, or performing Azure/Fabric service operations.