Repository navigation
improve(test): share compiled Crabbox wrapper fixtures - #188403
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. What this changesThis PR shares immutable compiled Crabbox fixtures through hard links, retains copying as a fallback, and lowers the test-line baseline. Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it makes a focused, useful test-fixture improvement, and the reviewed diff has no actionable findings. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Crabbox wrapper suite compiles wrapper and setup entry points, relocates their shared chunks into isolated fixtures, and launches subprocesses to verify routing, transport, and cleanup. flowchart TD
A[Wrapper and setup sources] --> B[Shared esbuild compilation]
B --> C[Immutable entry points and chunks]
C --> D[Hard links or copy fallback]
D --> E[Isolated fixture directories]
E --> F[Subprocess contract tests]
Technical reviewBest possible solution: Use the existing fixture owner to share immutable compiled files while preserving relocation paths, cleanup, and the copy fallback. Do we have a high-confidence way to reproduce the issue? This is a test-only refactor; source inspection confirms repeated compiled-file copying, and no target code was executed during this review. Is this the best way to solve the issue? The change removes redundant byte copies through the existing helper, preserves fallback behavior, and adds no unnecessary production machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d513a1144009. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests -6, Other 0. Total -6 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel 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, 10:27 AM ET / 14:27 UTC. |
|
Merged via squash.
|
What Problem This Solves
The Crabbox wrapper suite repeatedly copies thousands of immutable compiled files into temporary checkouts, adding filesystem work to a test priced at 173 seconds in the CI timing inventory.
User Impact
No user-visible change. Sharing immutable compiled fixture files removes repeated byte copies while preserving existing coverage. The corrected passing samples do not demonstrate a wall-time speedup.
Why This Change Was Made
Share compiled entrypoints and chunks with hard links, falling back to the existing copy operation when links are unavailable. Each checkout retains its own paths and cleanup ownership. Reuse the same fixture construction for the setup executable.
Production code, test cases, assertions, timeouts, and platform conditions are unchanged. Test lines decrease by six. The scalar is lowered to the exact tracked total, 6,295,757; the previous scalar already contained slack.
Evidence
test/scripts/crabbox-wrapper.test.ts, same host, command, and one worker. Only successful runs enter the medians:The corrected passing-baseline wall median is 201.48 s, versus 205.36 s after: 3.88 s slower (1.9%). Vitest medians are 199.38 s → 203.56 s, 4.18 s slower (2.1%). These observations do not establish wall-time savings. Ranges overlap (before 193.67–250.75 s; after 199.79–205.93 s), and host load and cache conditions vary; there is no guaranteed CI saving. CI has not yet retimed this change.
Failed observation, preserved separately and excluded from successful-run medians:
The failure was
transports verified source and dependencies (provider=blacksmith-testbox, shallow=false, scenario=transport): the fixture's localgit cloneexceeded its unchanged 10-second deadline (ETIMEDOUT,SIGTERM, observed 11,132 ms). Source inspection places this failure in fixture setup before wrapper invocation. The same case passed in original baseline observations 1 and 3, the added original-base observation 4, and all three after runs. The cause remains unresolved; a passing replay is not a repair. No timeout, assertion, or case was changed to obtain the added passing observation.All six successful runs pass 284 tests, with one existing Windows-only case skipped by its unchanged platform condition. Baseline observation 4 ran at original base
5ed4aa230f8996b7747f654c5bf26ad2e2a8860ain a detached worktree with a separate frozen dependency installation, pnpm store, temporary directory, XDG cache/data directories, and Vitest module cache. The new paths use the same filesystem as the original observations. The measured command includes its one-time pinned Bun cache download. The samples were not interleaved, and cache/host differences limit timing attribution. No tests were deleted; deleted-test → covering-test mapping: none. No shared test-support module changed, so there are no additional importing test files to run.Per-case profiling identifies CLI startup, source transport, and real child-tree cancellation as the remaining costs. First-baseline test bodies sum to 215.68 s; setup/runner account for roughly 33 s. The test module imports in about 95 ms. The wrapper exposes no in-process command API, so this change retains the actual subprocess contracts rather than introducing a production seam.
The bundle has 5,442 files totaling 138,620,769 bytes; 5,440 are shared by hard links in the relocated fixture. For passing runs, median
/usr/bin/time -vfilesystem output decreases from 20,071,616 to 3,920,600 blocks (80.5%). These counters also vary substantially: the added baseline produces 4,291,008 blocks, below after observation 2's 8,492,360; the ranges overlap. This is an observed median output reduction, not a guaranteed CI saving.Validation:
timeout 900 pnpm install --frozen-lockfile— passed.OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=<proof-dir>/vitest-cache-crabbox-wrapper timeout 600 /usr/bin/time -v pnpm test test/scripts/crabbox-wrapper.test.ts --maxWorkers=1 --reporter=verbose. Original observations 2–3 and added baseline observation 4 also enableOPENCLAW_VITEST_IMPORT_DURATIONS=1 OPENCLAW_VITEST_PRINT_IMPORT_BREAKDOWN=1. Added baseline installation:timeout 900 pnpm install --frozen-lockfile --store-dir <isolated-store>— passed; installation time is outside the test timing.timeout 300 node scripts/run-tsgo.mjs -p <proof-dir>/tsconfig-crabbox-wrapper.json --incremental --tsBuildInfoFile <proof-dir>/tsconfig-crabbox-wrapper.tsbuildinfo— passed. The temporary config extendstest/tsconfig/tsconfig.test.root.json, selects this test plus declaration files, and resolves installed Node types.timeout 180 node scripts/run-oxlint.mjs --tsconfig <proof-dir>/tsconfig-crabbox-wrapper.json test/scripts/crabbox-wrapper.test.ts— passed.timeout 60 pnpm format:check test/scripts/crabbox-wrapper.test.tsandgit diff --check— passed.timeout 120 pnpm check:test-lines-ratchet --base 5ed4aa230f8996b7747f654c5bf26ad2e2a8860a— passed. File: 6,684 → 6,678 lines; repository: 6,295,763 → 6,295,757 lines.gh pr view 159315 --json files— touches onlyextensions/crabbox/src/crabbox-worker-provider.test.ts; that file is untouched here.pr-simplifycompleted. Local autoreview (Codex, P0–P2) reviewed the final candidate against base5ed4aa230f8996b7747f654c5bf26ad2e2a8860a, with the full test and shim fixture as evidence:scoped-clean, no findings. Reviewed code is committed as9e1068aa27d82a1995aeff555616eeb2b633151d. Local ClawSweeper is unavailable; hosted ClawSweeper has acknowledged this PR and will report when review starts. No duplicate request was sent.CI checked once in this phase at 2026-10-30 14:07:46 UTC: run 41068654859 is
in_progresson exact head9e1068aa27d82a1995aeff555616eeb2b633151d; 2 jobs passed (includingsecurity-fast), 13 were running, and 28 were skipped, with no failed jobs observed.openclaw/ci-gateis pending. Comments/reviews contain only the ClawSweeper acknowledgment, with no review findings or inline comments. No CI rerun or merge was requested.Credit
Requested by Peter Steinberger for the OpenClaw test-health loop.
Work sessions