Repository navigation
chore(test): expose profiler help finalization stages - #148804
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 15, 2026, 2:05 AM ET / 06:05 UTC (Revision 2). ClawSweeper reviewWhat this changesAdds failure-only observations to profiler help tests showing whether profile finalization, inner-process exit, or child completion stopped progressing. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, bounded diagnostic improvement absent from current main. No actionable correctness or security findings remain, and the prior review identified no unresolved findings. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s test profiler launches Vitest and writes CPU profiles. These test-only observations follow profiling and subprocess shutdown, then feed the existing failure report when a help invocation fails or times out. flowchart TD
A[Profiler help test] --> B[Outer profiler process]
B --> C[Inner Vitest process]
C --> D[Stop profiler and write profile]
D --> E[Disconnect and exit]
E --> B
B --> F[Bounded stage log]
D --> F
F --> G[Failure diagnostic report]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +79. Total +79 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep finalization observations inside the existing test fixture and use future failure output to locate the stall before changing production shutdown behavior. Do we have a high-confidence way to reproduce the issue? Not applicable to this diagnostic-only change; the intermittent timeout remains unreproduced here, and the PR explicitly makes no timeout-fix claim. Is this the best way to solve the issue? Yes. Extending the existing failure observer is a focused way to distinguish finalization stages without changing deadlines, assertions, or production lifecycle ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bc7e0f115eba. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…tream profiler shutdown fixes openclaw#149010/openclaw#148804)
Related: #148610
What Problem This Solves
Profiler help tests can print usage and create a CPU profile file but still time out without showing whether finalization, inner process shutdown, or child completion stopped progressing. The cause remains unknown.
User Impact
No user-visible change. This maintainer-requested diagnostic makes future CI failures more informative; it does not claim to fix the timeout or attribute it to Fleet.
Why This Change Was Made
Extend only the existing help-case preload to record Inspector stop, the fixture CPU-profile write, disconnect, inner exit processing, and outer-observed child exit/close. The existing failure reporter reads at most 4 KiB from a separate fixture artifact; successful runs print none of it. Records contain only fixed roles/stages, numeric exit codes, and allowlisted signals, with no paths, config, profile contents, or error messages.
Production code, the hash-order observation and assertion, deadlines, spawn arguments/options, process-group ownership, and cleanup behavior remain unchanged. The original write Promise and ChildProcess are returned unchanged, and observer I/O failures are contained. These observations can narrow a future timeout but do not establish a native deadlock or identify a fix.
Evidence
Physical frozen-lockfile install; root-test TypeScript lane; targeted oxlint; oxfmt; git diff --check; and generated-preload syntax check all passed. Fresh isolated P2 review found no actionable findings. Local runtime/native profiling replay was intentionally not performed. Hosted CI run 34933540965 passed for
cbf449000adbeb4765a818ceb8cf483682227866. ClawSweeper’s review of that exact head also found no actionable defects. This qualifies the diagnostic candidate without proving that the intermittent timeout is fixed.