Repository navigation
test: accelerate provider shutdown recovery coverage - #159098
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 26, 2026, 2:56 PM ET / 18:56 UTC. ClawSweeper reviewWhat this changesThe branch speeds up a local-provider shutdown recovery test by observing real child close before advancing simulated POSIX deadlines, while leaving Windows timers real. Merge readiness✅ Ready for maintainer review Keep open. Current main still incurs both shutdown deadlines in this test, and the focused patch has no identified correctness defect. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw can start a local model-provider process and hold a lease while it serves requests. This test forces a shutdown observation failure, then checks that OpenClaw retains ownership and can start a healthy replacement. flowchart LR
A[Local provider request] --> B[Managed child and lease]
B --> C[Shutdown attempt]
C --> D[Exit observation]
D --> E[Retained service ownership]
E --> F[Replacement acquisition]
F --> G[Healthy replacement]
G --> H[Stopped child and free port]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +21. Total +21 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the real-process shutdown and reacquisition coverage within the CI time budget, including the ownership and cleanup assertions on both platforms. Do we have a high-confidence way to reproduce the issue? Yes. The current-main test still waits through the two real shutdown deadlines, and the PR gives a focused Linux before/after timing procedure; I did not execute it in this read-only checkout. Is this the best way to solve the issue? Yes. The change targets only the slow test case, waits for actual child close, and retains the failure, recovery, and Windows behavior checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8bb8609f59be. 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.
|
Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
The provider shutdown recovery test spent four seconds waiting after its real child had exited.
User Impact
No user-visible behavior change. Linux test runs retain the same shutdown and recovery coverage with less waiting; Windows keeps its existing timing.
Why This Change Was Made
The provider shutdown recovery test deliberately withholds the POSIX process-group exit observation. Even after its real child had closed, the test waited through both two-second shutdown deadlines.
Register and await the real child
closeevent before advancing the logical shutdown clock. The existing rejection, retained service ownership, replacement-process health, dead-PID, free-port, and cleanup assertions remain intact. Real timers and the liveness observation are restored before recovery. Windows retains real timers for asynchronoustaskkillsettlement; production behavior and the other three cases are unchanged.Evidence
Measured on Linux through Crabbox/Testbox, using all four cases and the normal runner, reporters, and cache policy at base
5790b128b7d609c2a6859066b905941c6f0c14c7:Mean full-command wall fell 43.2%; both candidate passes beat warm A2 by more than 41%. All 16 ordered case executions passed, source and dependency state were restored, and processes and the lease settled cleanly. CPU and memory savings are not claimed. Comparison run.
Independent review found no actionable issues. The required
pnpm test src/agents/provider-local-service.shutdown.test.ts --maxWorkers=1cost run passed all four cases in 6.594 seconds wall, including 0.554 seconds for the affected case. All 21 canonical changed-file checks passed in 245.185 seconds, including formatting, the agents test typecheck, and targeted lint with zero warnings or errors. Qualification run. Hosted CI passed on published head64dfaaa241b87757fe484045c9a71e165fc72f7e(attempt 1: 28 successful jobs, 21 intentional skips). Linux passed all four cases: the affected recovery case took 559 ms, the file took 6.17 s in Vitest / 7.26 s through its wrapper, and the complete one-file command took 8.20 s. The job took 64 s including setup.Windows passed its three applicable cases and retained the existing POSIX-only signal-handler skip. Its recovery case took 6.637 s with real timers, as intended. No standalone Windows file wall was emitted: the containing nine-file agents shard took 23.34 s, and its full eight-shard job took 334.01 s through the wrapper / 422 s including setup. These hosted costs are separate from the controlled Linux comparison; no Windows speedup is claimed.
Both target jobs tested merge
fe94c74db4c818584355fd3203703eaaa60f91ef, with maind0931ccefcc25dae4853cc4ac1921c2ff5f58e51and the published head as parents. The test, provider process/lifecycle owners, fixture helpers and dependency inputs match the head. The two differing selected tooling files only add a separate CLI message fixture registration and compiler boundary.Completed ClawSweeper review found no actionable correctness or security issues. Its reviewer could not retrieve the redirected Testbox logs; the original execution records were independently verified by the maintainer, and hosted CI supplies fresh Linux and Windows proof.
Post-merge verification
Merged as
bfd690f4cac121e476055621898df2a46410aa89, with the exact reviewed patch verified on captured main915e37b7ddcbf884a78cb650e9463bfa9f0000e9. The post-merge Crabbox smoke passed all four cases in 6.222 seconds full-command wall; the affected recovery case took 550 ms. Source, dependencies, index, process settlement, and cleanup were verified, and the lease is stopped. The normal wrapper rebuilt a source mirror before testing; that setup cost is recorded separately. No test retry or comparison was performed.Initial native receipt verification saw the pre-merge main commit. Read-only reconciliation confirmed the original merge and completed the native landing record and cleanup; no second merge request was submitted.