Skip to content

fix(jest): preserve passing exit code during teardown#140

Open
mrousavy wants to merge 1 commit into
callstackincubator:mainfrom
mrousavy:codex/fix-harness-teardown-exit
Open

fix(jest): preserve passing exit code during teardown#140
mrousavy wants to merge 1 commit into
callstackincubator:mainfrom
mrousavy:codex/fix-harness-teardown-exit

Conversation

@mrousavy
Copy link
Copy Markdown

@mrousavy mrousavy commented Jun 5, 2026

Summary

  • Track whether a Harness run has actually completed before teardown/signal handling decides the process exit code.
  • Preserve exit code 0 for a late SIGINT/SIGTERM after a completed passing run, while still failing incomplete or failed runs.
  • Let the shared spawn cleanup terminate child processes without racing Harness session disposal for the parent process exit code.

Verification

  • pnpm exec vitest run packages/jest/src/__tests__/harness-session.test.ts packages/jest/src/__tests__/execute-run.test.ts
  • pnpm nx typecheck @react-native-harness/jest --skip-nx-cache
  • pnpm nx lint @react-native-harness/jest --skip-nx-cache && pnpm nx lint @react-native-harness/tools --skip-nx-cache

Notes

  • Full pnpm nx test @react-native-harness/jest --skip-nx-cache still fails locally in existing src/__tests__/bridge.test.ts cases because WebSocket is not defined in the test environment; the new/modified execute-run and harness-session tests pass in that run.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

@mrousavy is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant