Repository navigation
improve(test): speed up Crabbox staging recovery checks - #188561
Conversation
Co-authored-by: steipete <[email protected]>
|
🦞👀 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. What this changesThis PR reuses the prepared Crabbox wrapper runtime in staging recovery tests and lowers the test-line ceiling. Example: A developer runs the Crabbox staging recovery suite in the reported Linux container.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it is a focused, maintainer-directed test optimization that preserves recovery coverage, with no actionable introduced defect found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe staging recovery suite creates isolated Git repositories and abandoned source capsules, invokes the public Crabbox wrapper, and checks recovery decisions, retained source, claims, diagnostics, and child cleanup. flowchart LR
A[Staging recovery tests] --> B[Prepared wrapper environment]
B --> C[Public Crabbox wrapper]
C --> D[Prepared staging modules]
D --> E[Git witnesses and native claims]
D --> F[Recovery result and retained files]
Technical reviewBest possible solution: Reuse the existing prepared-wrapper owner while retaining the public launcher, recovery assertions, process supervision, and exact shrink-only ceiling. Do we have a high-confidence way to reproduce the issue? This is a test-performance improvement rather than a product bug; the supplied comparisons exercise the changed suite, and no target code was executed during this read-only review. Is this the best way to solve the issue? The change removes repeated source-runtime loading through an existing helper without adding a cache, production seam, or competing owner; the unused fixture fields have no remaining consumers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 52fbfb7d9892. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests -1, Other 0. Total -1 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 30, 2026, 1:41 PM ET / 17:41 UTC. |
|
Merged via squash.
|
Normalize the shared scalar to the native census total minus all existing named allocations. Preserve 152 grants totaling 19,943 lines and zero headroom. Correct the stale measurement from #188561 without changing test-growth policy.
Co-authored-by: steipete <[email protected]>
Normalize the shared scalar to the native census total minus all existing named allocations. Preserve 152 grants totaling 19,943 lines and zero headroom. Correct the stale measurement from openclaw#188561 without changing test-growth policy.
What Problem This Solves
Crabbox staging recovery tests repeatedly load the source runtime even though their invocation has already prepared that runtime.
User Impact
Faster focused test feedback for developers: median wall time falls from 107.29s to 85.37s, saving 21.92s (20.4%) in the same capped container. No user-visible product behavior changes.
Why This Change Was Made
Reuse the existing
preparedScriptWrapperEnvhelper and wrapper entrypoint declaration. The public.mjswrapper, source module identity, managed-child supervision, native receipts, SQLite locks, reallsofcustody checks, source witnesses, and teardown remain exercised. Resolve the immutable capsule URL once and remove three unused fixture fields.No production code or shared helper changes. All 40 behavioral cases and assertions remain. This is separate from the already-landed wrapper fixture-copy change in #188403.
Evidence
All six whole-file runs passed 40/40 cases. Same command, source snapshot, frozen dependencies, toolchain, container, resource caps, and warmed compiler-output cache before and after:
timeout 600 /usr/bin/time -v pnpm test test/scripts/crabbox-staging.test.ts --maxWorkers=1 --reporter=verboseMedian Vitest duration: 103.68s → 81.08s. Median total CPU: 109.33s → 93.64s (14.4% lower). Median peak RSS: 583.5 → 591.1 MiB (slightly higher; no memory-saving claim).
Environment, profile, coverage, and limitations
22dd7c73db8d, labelsloop=test-health,lane=crabbox-staging, 4 CPUs / 8 GiB, private PID/mount namespaces, default isolated networking, no published ports, no real home/state/credential/socket mounts. Container memory events report zero OOMs.node:24.22.1-bookwormbase image IDsha256:739f342b809d803f7351c2825e9bb6eb31ace41d16373f2ff3048270261d0d66; Node 24.22.1, pnpm 12.15.0, Git 2.53.0,lsof4.95.0-1, repository-pinned Bun fork. Git source archive SHA-256:5818bd7d80b061bbbdfec8a433d609dc8818a05991f731ffc4a561e2ca18c653.6dfcb4cfbad19296ec97b743d7510f40b8908d65at original head2eef065f0f89960d0aaebfc64647386715cc9abe; its dependencies were installed withpnpm install --frozen-lockfile. Cache environment:OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/proof/vitest-cache; import-duration instrumentation enabled in all six runs.lsofcould not inspect host mounts; initial container with Git 2.39.5 28 passed / 12 failed because that Git lacks the witness owner's--no-lazy-fetchflag. The isolated namespace and pinned Git corrected those setup gaps without filteringlsofor changing custody admission.pr-simplifycompleted: existing owner/helper reuse, unused fixture surface removed, no new production seams.Focused verification passed:
git diff --check.Fresh isolated Codex autoreview of the complete local candidate against
2eef065f0f89960d0aaebfc64647386715cc9abe: P0–P2 scoped-clean, no findings. Full target-file and owner context supplied; static review did not rerun the implementation-agent measurements. Helper source receipt:ea4d3415094d50a670f28a1ee092e928a9dbcf7327103014c3a9f909d9a6ef17.Credit
Requested by Peter Steinberger (@steipete) for the test-health campaign; human co-author credit is retained in the commit.
Work sessions