Skip to content

fix(node): throw for child_process sync failures#1949

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-child-process-sync-throw
May 27, 2026
Merged

fix(node): throw for child_process sync failures#1949
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-child-process-sync-throw

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

@andrewtdiz andrewtdiz commented May 27, 2026

Summary

  • Fixes node:child_process — execSync/execFileSync do not throw on non-zero exit #1938 by making child_process.execSync and execFileSync throw when the child exits non-zero.
  • Captures the child pid while waiting so the thrown Error-like value exposes enumerable status, signal, output, pid, stdout, and stderr fields.
  • Adds a focused node-suite/child_process/sync/nonzero-throw parity fixture covering success paths, stderr capture, execFileSync args, and both sync failure helpers.

Verification

  • Baseline before fix: PERRY_NO_CACHE=1 ./run_parity_tests.sh --suite node-suite --module child_process --filter nonzero-throw failed because Perry printed execSync no throw: out where Node entered catch.
  • PERRY_NO_CACHE=1 ./run_parity_tests.sh --suite node-suite --module child_process --filter nonzero-throw PASS.
  • PERRY_NO_CACHE=1 ./run_parity_tests.sh --suite node-suite --module child_process PASS 1/1.
  • PERRY_NO_CACHE=1 ./run_parity_tests.sh --filter test_parity_child_process PASS.
  • cargo test -p perry-runtime child_process --lib PASS with pre-existing warnings.
  • cargo fmt --all -- --check PASS.
  • jq empty test-parity/known_failures.json PASS.
  • git diff --check PASS.

Non-goals

@andrewtdiz andrewtdiz force-pushed the codex/node-compat-child-process-sync-throw branch from e7d2dbb to e1df594 Compare May 27, 2026 07:10
@proggeramlug proggeramlug merged commit f202bd2 into PerryTS:main May 27, 2026
10 checks passed
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.

node:child_process — execSync/execFileSync do not throw on non-zero exit

2 participants