Repository navigation
test(cli): diagnose stalled Doctor test children - #151161
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 17, 2026, 9:07 PM ET / September 18, 2026, 01:07 UTC (Revision 6). ClawSweeper reviewWhat this changesRoutes Doctor process tests through shared timeout diagnostics and preserves their temporary files until child cleanup is verified. Merge readiness✅ Ready for maintainer review This PR remains useful: current main lacks the Doctor harness migration and joined cleanup. The earlier budget and fixture-lifetime findings are addressed, and no remaining actionable defect was found. Priority: P3 Review scores
Verification
How this fits togetherDoctor process tests launch isolated CLI commands against temporary configuration and state. The shared child harness captures output and diagnoses timeouts, while fixture owners control when test files can be removed. flowchart TD
A[Doctor process tests] --> B[Isolated CLI child]
B --> C[Output and deadline monitor]
C --> D[Timeout diagnostics]
D --> E[Verify child exit and output EOF]
E --> F{Cleanup verified?}
F -->|Yes| G[Release temporary fixtures]
F -->|No| H[Retain fixtures and original failure]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +633. Total +633 across 16 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use the existing child and fixture owners to preserve diagnostic evidence and command deadlines, while investigating the original intermittent hang separately. Do we have a high-confidence way to reproduce the issue? Yes for the harness defects: source shows cleanup can settle before child exit, and focused regressions cover stalled children and retained fixtures. The original intermittent production Doctor hang remains unreproduced; no tests were executed during this review. Is this the best way to solve the issue? Yes. Reusing the existing diagnostic, child-stop, and fixture-lifetime owners repairs the test boundary while preserving command deadlines, launcher handoff, and production behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 00e7e263a157. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
Addressed this finding: |
|
I found a cleanup ownership gap in the migrated CLI child harness: timeout/error rejection can reach fixture teardown after SIGKILL and pipe destruction are requested, but before the direct child exits. If forced cleanup fails, the temporary-home owner can also remove state while that child is still live. I have a five-file follow-up that joins bounded direct-child and pipe cleanup through the existing stop helper, preserves the original diagnostic cause, and uses the existing unjoined-work marker to retain the home and its Vitest resource claim when cleanup cannot be confirmed. It preserves detached-service handoff and every child deadline. I am composing it with e614edc, reserving cleanup separately in the derived enclosing test budget. The underlying intermittent Doctor exit hang remains unreproduced. The cleanup and retention regressions fail before their repairs and pass afterward. I am coordinating the follow-up here before updating this existing PR; please flag any ongoing branch edits so we can serialize the update. |
|
No edits in flight on this branch from my side — the last push was |
|
The cleanup follow-up is now in Validation passed: 100 selected scenarios, the final 17-case harness, the full selected fourteen-file check, and fresh independent P2 review. The original exit hang remains unreproduced. The PR body now distinguishes current cleanup proof from historical Linux/CI results. I will handle native landing after fresh CI and review, coordinated with the dependent catalog work in #150831; no separate merge action is needed from the earlier author lane. A review of this new head is welcome. |
Route shared built/source fixtures through the existing CLI child diagnostic owner and await all callers. Preserve deadlines, runtime flags, command order, and output limits while reporting active resources and native timeout reports. Instrument the unreproduced occurrence from #151124, run 35271931496, job 105373599081. This is test instrumentation, not a production exit-path fix.
Derive enclosing test budgets from the sequential child execution windows, the harness diagnostic grace, and a fixed setup/assertion margin. Preserve all child deadlines while allowing their diagnostic failures to reach Vitest. Cover the three reviewed deadline collisions and cumulative variants across 14 cases. Prove the former equal-deadline failure with a retained timer under Vitest's actual enclosing timeout.
Join forced child exit and natural output EOF before settling failures. Keep diagnostic reports and migrated Doctor input/state fixtures when inherited output or cleanup remains unverified, without changing command deadlines or successful launcher handoff.
f53ec21 to
83151df
Compare
|
Additional matching-main evidence for the existing Doctor exit-hang investigation (from readiness work on #151232):
The logs and main-run identity were independently checked. They locate the incomplete validation subprocess, but do not distinguish a stuck disposer, live handle, descendant, or inherited output pipe. No timeout increase or retry is proposed as a substitute for diagnosis. Routing this evidence to your existing diagnostic/cleanup effort rather than creating a competing repair. Please include this occurrence in the underlying-hang follow-up and link any established cause/fix back to #151232. The current PR description correctly distinguishes diagnostic/cleanup improvements from a proven hang fix. I will not modify or merge this branch; its existing owner retains landing responsibility. |
|
Update: I am taking native landing of the unchanged head Exact-head CI passed, and the current ClawSweeper review has no before-merge findings. All sixteen PR files are byte-identical to my independently qualified integration with the shared diagnostic-report collector; package, lockfile, and workspace inputs also match. Fresh local validation passed 28 focused cases, the complete selected sixteen-file gate, and independent P2 review. These results cover the matching files; the complete Git trees are not identical. My local integration remains retained as evidence, and The underlying exit hang remains unproven. Another occurrence is recorded in the catalog run: Node 24.19.0, explicit local model=true. As in the matching-main evidence above, the initial Coordination history: my original version of this comment returned landing custody to the earlier author while CI was pending. The bounded ownership lookup found no identified active lane or confirmed accepted dispatch. The current ownership is the takeover stated above. |
|
Merged via squash.
|
Doctor process tests could time out without diagnostics, then release fixtures before child cleanup completed. Route built/source fixtures through the shared CLI diagnostic harness, join direct-child exit and natural output EOF, and retain reports, input/state fixtures, and resource claims when cleanup is unverified. Preserve the original failure, command deadlines, command order, flags, output limits, and successful launcher handoff. Use getCliProcessTestTimeout to reserve enclosing diagnostic and cleanup time without extending child execution deadlines. This changes tests and test support only; the intermittent production exit hang remains unreproduced. Signal delivery to the CLI respawn wrapper rather than the command grandchild remains a report-only follow-up. Related: openclaw#151124, openclaw#150831. Thanks to @jalehman for additional matching-main timeout evidence. Validation: exact-head CI run 35293520168 is green; approved committed-branch review is scoped-clean through P1; exact-head ClawSweeper review has no actionable findings or remaining Rank-up moves. The integration owner also reported 28 focused cases and the selected sixteen-file gate passing on byte-identical changed files.
…151339) Restore filesystem import-boundary, workflow-routing, and full-suite inventory guards after the changes in #151302, #151282, and #151001. Route native filesystem configuration through the existing facade, register the recovery and Codex attempt tests in their existing owners, and select those guards when their inventory inputs change. Includes the reviewed routing repair from #151340 with its original human authorship preserved. Finalize the existing Gateway serial admission and two-worker ceiling before runtime placement reads recipient policy. This preserves compact worker limits when inventory changes without changing timing measurements, original compaction assertions, configuration, dependencies, or user-facing runtime behavior. Validation: exact-head CI run 35306657804 completed green; the native watcher exited 0 with no pending checks. Retained focused proof passed 1,591 tests across six files, with both new placement regressions failing before the repair and all four placement cases passing after it. Committed-branch review found no actionable defects. The pre-existing diagnostics test-support lint issue from #151161 remains an explicitly nonblocking follow-up.
Bind the diagnostic preload dispatcher to process and add a discovery project limited to source CommonJS test support. Exercise the installed linter to prove both TypeScript and CommonJS support report unbound methods while unrelated JavaScript remains outside the project. Related: #151161, #150959.
Bind the diagnostic preload dispatcher to process and add a discovery project limited to source CommonJS test support. Exercise the installed linter to prove both TypeScript and CommonJS support report unbound methods while unrelated JavaScript remains outside the project. Related: #151161, #150959.
Bind the diagnostic preload dispatcher to process and add a discovery project limited to source CommonJS test support. Exercise the installed linter to prove both TypeScript and CommonJS support report unbound methods while unrelated JavaScript remains outside the project. Related: #151161, #150959.
Extend the existing type-aware core lint checks to CommonJS CLI test support through a bounded discovery project. Preserve TypeScript coverage and exclude unrelated JavaScript, with installed-linter regression coverage and CI documentation. Main already contains the diagnostic dispatcher binding; this change closes the remaining lint discovery gap. No user-visible runtime behavior changes. Related: #151161, #150959. Validation: exact-head CI run 35354844001 was green with zero pending jobs; scoped Codex review and the latest ClawSweeper review found no actionable correctness issues.
…penclaw#151339) Restore filesystem import-boundary, workflow-routing, and full-suite inventory guards after the changes in openclaw#151302, openclaw#151282, and openclaw#151001. Route native filesystem configuration through the existing facade, register the recovery and Codex attempt tests in their existing owners, and select those guards when their inventory inputs change. Includes the reviewed routing repair from openclaw#151340 with its original human authorship preserved. Finalize the existing Gateway serial admission and two-worker ceiling before runtime placement reads recipient policy. This preserves compact worker limits when inventory changes without changing timing measurements, original compaction assertions, configuration, dependencies, or user-facing runtime behavior. Validation: exact-head CI run 35306657804 completed green; the native watcher exited 0 with no pending checks. Retained focused proof passed 1,591 tests across six files, with both new placement regressions failing before the repair and all four placement cases passing after it. Committed-branch review found no actionable defects. The pre-existing diagnostics test-support lint issue from openclaw#151161 remains an explicitly nonblocking follow-up.
…aw#151385) Extend the existing type-aware core lint checks to CommonJS CLI test support through a bounded discovery project. Preserve TypeScript coverage and exclude unrelated JavaScript, with installed-linter regression coverage and CI documentation. Main already contains the diagnostic dispatcher binding; this change closes the remaining lint discovery gap. No user-visible runtime behavior changes. Related: openclaw#151161, openclaw#150959. Validation: exact-head CI run 35354844001 was green with zero pending jobs; scoped Codex review and the latest ClawSweeper review found no actionable correctness issues.
Capture bounded process and Linux thread state before requesting child diagnostics. Preserve the original deadlock failure and cleanup when JavaScript cannot answer SIGUSR2. Related to #151161.
Stalled CLI test children can miss both JavaScript diagnostic signals, leaving the deadlock guard without OS evidence. Capture bounded PID ancestry, process state, and Linux thread wait channels, stacks, and signal status in the shared CLI test harness before requesting Node diagnostics. Preserve the existing deadline failure and joined child/pipe cleanup. Test instrumentation only; no user-visible runtime change. The intermittent CLI exit failure remains unproven. Related: #151161. Validation: 18/18 helper tests, busy-loop and SIGSTOP regression checks on macOS and Linux, 30 full-shard runs (1,260 cases), and 200 focused repetitions. Exact-head CI passed; campaign review and ClawSweeper found no actionable defects. Production LOC: 0; tests and test support: +165/-33.
Stalled CLI test children can miss both JavaScript diagnostic signals, leaving the deadlock guard without OS evidence. Capture bounded PID ancestry, process state, and Linux thread wait channels, stacks, and signal status in the shared CLI test harness before requesting Node diagnostics. Preserve the existing deadline failure and joined child/pipe cleanup. Test instrumentation only; no user-visible runtime change. The intermittent CLI exit failure remains unproven. Related: openclaw#151161. Validation: 18/18 helper tests, busy-loop and SIGSTOP regression checks on macOS and Linux, 30 full-shard runs (1,260 cases), and 200 focused repetitions. Exact-head CI passed; campaign review and ClawSweeper found no actionable defects. Production LOC: 0; tests and test support: +165/-33.
Related: #151124, #150831
What Problem This Solves
Doctor process tests could time out without collecting diagnostics. After switching those tests to the shared asynchronous CLI harness, failure cleanup also needed to finish before their input, state, and diagnostic fixtures were deleted.
User Impact
Test infrastructure only. The intermittent CLI exit hang observed in CI remains unreproduced locally; this PR makes a future occurrence diagnosable and keeps failure cleanup from losing its evidence. Child execution deadlines, command order, runtime flags, output limits, and exit-code assertions are unchanged.
Why This Change Was Made
Built/source runtime tests use the existing diagnostic harness from #150288 and #151088, including main's shared Node report collector. The enclosing test budget covers sequential child deadlines plus diagnostic grace, a separate five-second cleanup allowance, and the existing setup/assertion margin. A timeout remains a failure even if the child exits during diagnostics or cleanup.
Cleanup joins forced direct-child exit and natural output EOF before closing local pipe endpoints. This preserves successful launcher handoff and detects a detached child that still owns inherited output. If cleanup cannot be verified, the original error is retained and the existing fixture-lifetime owner preserves diagnostic reports, HOME/state, input runtimes, and resource claims. All migrated callers use that owner with their existing afterEach/afterAll timing. No process-group kill, new supervisor, or deadline extension is introduced.
Evidence
Current head:
83151dfda804117818905887cffe7b6b450a828f.The original Doctor timeout, the matching-main evidence in this PR's discussion, and the latest catalog occurrence remain recorded. The last occurrence printed the expected invalid-config report and timed out in the initial config-validation child, before Doctor ran. This change repairs diagnostic and cleanup ownership; it does not establish the cause of those hangs. No failed CI jobs were blindly retried.