Repository navigation
test: shorten Doctor migration-order process checks - #159609
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 27, 2026, 7:24 AM ET / 11:24 UTC. ClawSweeper reviewWhat this changesThe branch runs three isolated Doctor migration-order checks concurrently and binds child diagnostic cleanup to each test, while adapting other callers to the helper’s options argument. Merge readiness✅ Ready for maintainer review Current main still runs the three cases serially. This is a focused test optimization with no actionable correctness defect found, so the PR remains useful. Priority: P3 Review scores
Verification
How this fits togetherDoctor is OpenClaw’s CLI repair command for configuration and stored state. This process suite seeds separate state fixtures, runs the built CLI, and checks migration order and persisted results. flowchart LR
A[Built CLI] --> C[Concurrent test cases]
B[Three state fixtures] --> C
C --> D[Isolated Doctor processes]
D --> E[Migration assertions]
E --> F[Per-test cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +11. Total +11 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the existing Doctor process assertions and per-case cleanup under Vitest’s concurrency controls. Do we have a high-confidence way to reproduce the issue? Not applicable as a product bug. Current main shows the serial baseline, and the PR body reports a four-arm process-command comparison. Is this the best way to solve the issue? Yes. The cases already have separate state and ports, and the patch uses Vitest’s concurrency mechanism while keeping diagnostic cleanup tied to each case. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2d65bdd956d9. 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.
|
* commit '69809d7a94277d01be964bd1cbbb7aa0ebc58c9b': (219 commits) perf(agents): serialize large model requests once (#159574) refactor(cli): share capability agent-selection test cases (#159616) fix(workers): restore installation type checks (#159629) test(channels,qa,providers): remove low-value tests (batch d065) (#159627) test(doctor): run isolated migration cases concurrently (#159609) feat(apple): show agent identities in native chat (#159528) chore(i18n): refresh native locales (#159635) fix(gateway): keep node provisioning's installation contract after overlapped preparation fix(models): keep shared catalog requests alive for remaining callers (#157191) feat: let agents query online people and device activity (#159117) perf(gateway): first cloud dispatch prepares worker artifacts one after another (#159520) refactor(android): deslop Android app third pass (#159589) test(qa-lab,openshell,slack,reef,team-reports): remove low-value tests (batch d064) (#159607) fix: align process liveness checks (#151107) thanks @ekinnee fix: sessions model default does not clear the override (#159587) fix(ios): preserve typing during reentrant SwiftUI updates fix(ci): frozen 2026.8.33 validation fails on inherited test clock (#159594) perf(gateway): avoid duplicate recipient row lookup (#159595) refactor(gateway): deslop gateway fourth pass (#158786) test(agents): split subagent task-settlement test support under the line cap (#159584) ...
* commit '69809d7a94277d01be964bd1cbbb7aa0ebc58c9b': (219 commits) perf(agents): serialize large model requests once (#159574) refactor(cli): share capability agent-selection test cases (#159616) fix(workers): restore installation type checks (#159629) test(channels,qa,providers): remove low-value tests (batch d065) (#159627) test(doctor): run isolated migration cases concurrently (#159609) feat(apple): show agent identities in native chat (#159528) chore(i18n): refresh native locales (#159635) fix(gateway): keep node provisioning's installation contract after overlapped preparation fix(models): keep shared catalog requests alive for remaining callers (#157191) feat: let agents query online people and device activity (#159117) perf(gateway): first cloud dispatch prepares worker artifacts one after another (#159520) refactor(android): deslop Android app third pass (#159589) test(qa-lab,openshell,slack,reef,team-reports): remove low-value tests (batch d064) (#159607) fix: align process liveness checks (#151107) thanks @ekinnee fix: sessions model default does not clear the override (#159587) fix(ios): preserve typing during reentrant SwiftUI updates fix(ci): frozen 2026.8.33 validation fails on inherited test clock (#159594) perf(gateway): avoid duplicate recipient row lookup (#159595) refactor(gateway): deslop gateway fourth pass (#158786) test(agents): split subagent task-settlement test support under the line cap (#159584) ...
) Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Doctor's migration-order process tests run three independent state fixtures sequentially, extending the test command even though each case owns its databases, configuration, and port.
User Impact
There is no user-visible behavior change. The measured test command completes about 11 seconds sooner than the warm baseline. Mean total CPU increased by 3.8%; this is a wall-time improvement, not a CPU or memory saving.
Why This Change Was Made
Run the three isolated cases concurrently through Vitest and bind child diagnostic cleanup to each case's test context. The shared helper keeps its existing default for serial callers. All five real Doctor invocations, migration ordering, repeated-run idempotency, lost-journal byte preservation, output limits, deadlines, and cleanup remain intact.
Vitest owns the concurrency limit. Its existing
--maxConcurrency=1option provides serial execution;--maxWorkersindependently limits file workers. Aggregate concurrent memory and constrained-host performance have not been measured.Evidence
Blacksmith Testbox comparison at
fb720291b0a30ddf67336fe2c87dbebfac01db45, using the ordinary commandpnpm test src/commands/doctor-agent-database-order.process.test.tswith normal runtime build and worker preparation included:Both candidate arms beat warm A2 by 13.7–13.8%. All 12 case executions passed, preserving the same identities and assertions. The longest candidate case took 17.221 s under the unchanged 60 s child deadline. Native preparation and build timings overlap with command wall and must not be added to it.
Comparison run. Source restoration, process settlement, and completed lease cleanup were verified. No test retries.
Qualification run passed all 21 case executions and the 21 selected changed-file checks, including all 15 test typecheck graphs. Single-file author costs (
pnpm test <file> --maxWorkers=1, normal preparation included):Doctor also passed all three cases with
--maxWorkers=1 --maxConcurrency=1in 74.321 s, in exact source order. This validates the existing serial option; it is not a constrained-hardware benchmark. The changed-file gate took 747.009 s. These tests retain real built CLI and process flows because mocks would omit bootstrap, migration, and diagnostic behavior. No new test cases were added.Independent P0–P2 review found no actionable issues. Hosted CI passed on published head
f9bc5317b81b518e7e61c85255a3f9484c67a8f4(attempt 1: 68 successful jobs, 22 intentional skips). All 18 cases across the four edited test files passed. The shared helper selected 35 changed-test jobs.Case-duration sums are not standalone file wall times; the three migration cases overlap. The three containing commands took 148.60 s, 270.74 s, and 274.65 s; their jobs took 243 s, 327 s, 334 s including setup. Recorded normal worker preparation was 13.929 / 14.622 / 20.972 s, already included rather than additive. Doctor output and Skills SAG share the third job.
Original checkout logs bind this proof to merge
fdb1a8a1ce12fda9762c6ebe30f567a65ecb067d, containing the published head and main7f43b351149930f7db5b4545ad4df4693fe168fc. These hosted costs do not replace the controlled comparison or establish aggregate-memory savings. Completed ClawSweeper review found no actionable correctness or security issues; the reviewer could not access the linked raw Testbox logs, which the maintainer verified independently.Post-merge verification at
1ab9e1baec39aa3d1ce8a538d1e788603d229b1d: all six smoke cases passed with Node 24.19.0 and the landed revision's pnpm 12.5.0 dependencies. The ordinary Doctor migration-order and runtime-diagnostics commands took 66.817 s and 15.800 s, including normal preparation. Source, dependency, index, process settlement, and completed lease cleanup were verified.