Skip to content

test:unit: keep Node WASI exit status instead of Symbol(kExitCode)#632

Open
ledsun wants to merge 1 commit intoruby:mainfrom
ledsun:fix/test-unit-wasi-exit-code
Open

test:unit: keep Node WASI exit status instead of Symbol(kExitCode)#632
ledsun wants to merge 1 commit intoruby:mainfrom
ledsun:fix/test-unit-wasi-exit-code

Conversation

@ledsun
Copy link
Contributor

@ledsun ledsun commented Mar 23, 2026

Summary

run-test-unit.mjs uses Node's WASI implementation to initialize Ruby and then runs tests via vm.evalAsync().

In that setup, proc_exit can end up showing up as Symbol(kExitCode) instead of a normal process exit code. That makes test:unit fail with an unhandled rejection on Node 20/22/24, and the actual exit status is harder to use from the test runner.

This changes the Node WASI setup in run-test-unit.mjs to use returnOnExit: false, so Node exits with the WASI status directly.

Fix #628

Set returnOnExit to false for the Node WASI instance used by run-test-unit.mjs. In this setup, proc_exit from Ruby can otherwise show up as Symbol(kExitCode) instead of a normal process exit code. Letting Node terminate with the WASI status keeps test failures observable via the runner's exit code.
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.

test:unit fails with UnhandledPromiseRejection "Symbol(kExitCode)" on Node.js 20/22/24

1 participant