Repository navigation
fix(test): preserve managed child fixtures under Bun - #139834
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 2:28 AM ET / 06:28 UTC. ClawSweeper reviewWhat this changesRepairs Bun compatibility in managed-child-process tests by preserving real process exports, isolating snapshot stubs, and skipping rescue cleanup for children without a PID. Merge readiness✅ Ready for maintainer review This remains a useful, narrowly scoped fixture repair that is absent from inspected main and the latest release. No blocking patch defect was found; the maintainer-authored, protected PR should remain open for normal landing. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s tooling supervises child commands, forwards cancellation, and verifies process-tree cleanup. These tests combine synthetic process snapshots with real child fixtures to check lifecycle outcomes and retained errors. flowchart TD
A[Node or Bun test runner] --> B[Managed child fixtures]
B --> C[Real child commands]
B --> D[Controlled process snapshots]
C --> E[Process lifecycle supervisor]
D --> E
E --> F[Exit and cleanup assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +6. Total +6 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the repair within the fixture layer while preserving real subprocess execution, cleanup ownership, and original failure diagnostics. Do we have a high-confidence way to reproduce the issue? Yes for the no-PID cleanup path: source shows the previous guard could call expectProcessPid(undefined). The Bun interception failures are supported by the author’s reported run, but were not independently executed. Is this the best way to solve the issue? Yes. A partial module mock addresses the named-import interception boundary while retaining real fixtures, and the PID guard narrowly handles failed spawning without weakening successful-child cleanup. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d5144e4a97a9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Fixes nine managed-child fixture failures under Bun: eight snapshot cases did not intercept the intended child-process function, and a failed-spawn cleanup attempted to inspect a process that had no PID.
Why This Change Was Made
Use a partial test module mock that preserves real exports, clears each snapshot row's call history, and verifies the expected process-snapshot observation. Attempt rescue cleanup only when a child was actually spawned.
User Impact
No production behavior changes. The existing managed-process lifecycle coverage runs consistently on Node and Bun.
Evidence