ReviewOS

home-lang/home

Port Bun.spawn AbortSignal matrix

#150
Closed chris opened this 10 days ago ·
10 days ago

Track the adjacent subprocess cancellation slice from #66 and #149.

Upstream byte-identical corpus file:

  • js/bun/spawn/spawn-signal.test.ts (69 lines, 4 tests)

Scope:

  • activate the exact matrix instead of rewriting it to a native TODO
  • validate that signal is an AbortSignal before spawning
  • terminate pending async subprocesses when their signal aborts and settle exited nonzero
  • handle already-aborted/rapidly-aborted signals without a race
  • model spawnSync with AbortSignal.timeout() as an interrupted unsuccessful result
  • keep cancellation latency below the upstream bounds without leaking listeners

Acceptance:

  • exact matrix: 4 pass, 0 fail, 0 unsupported, 0 todo
  • copied corpus remains byte-identical to ~/Code/bun
  • full Home gate passes
  • commit/push directly to main as Chris Breuer with no coauthors
  • close this issue with evidence and link it from #66.
10 days ago

Implemented and pushed in f10e1543d1010d3de893b3e9966a62b84b991fba.

Ported behavior:

  • validates Bun.spawn / Bun.spawnSync signal values with ERR_INVALID_ARG_TYPE
  • models async cancellation, already-aborted signals, listener cleanup, and SIGTERM termination
  • models sync interruption and adds the missing AbortSignal.timeout() compatibility behavior
  • removes this exact upstream corpus file from the TODO rewrite and adds a durable Home regression

Verification:

  • exact upstream byte comparison against ~/Code/bun/test/js/bun/spawn/spawn-signal.test.ts: pass
  • spawn-signal.test.ts: 4 passed, 0 failed, 0 unsupported, 0 todo
  • regression recheck spawn-kill-signal.test.ts: 16 passed, 0 failed, 0 unsupported, 0 todo
  • ./pantry/.bin/zig build test -Dfilter=home_test --summary failures: exit 0

Sign in to comment on this issue.