Repository navigation
perf(test): avoid Canvas Git timeout wait - #124547
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 8:04 AM ET / 12:04 UTC. ClawSweeper reviewWhat this changesThe PR injects the Canvas bundle script’s Git runner for a fast timeout-policy test and changes the real fallback integration to compare normal and failed-Git bundle hashes. Merge readiness✅ Ready for maintainer review Keep open. This maintainer-authored Canvas test-performance refactor remains necessary because current main still waits for the real Git timeout; the patch preserves production fallback behavior while covering the timeout policy without sleeping, with no blocking correctness or security finding. Priority: P3 Review scores
Verification
How this fits togetherCanvas builds a checked-in A2UI browser bundle from tracked package and source inputs. The bundle script first asks Git for those inputs, falls back to filesystem traversal when Git fails, then hashes the inputs before deciding whether to rebuild. flowchart LR
A[Canvas A2UI sources] --> B[Input discovery]
B --> C{Git list succeeds?}
C -->|yes| D[Tracked input hash]
C -->|no| E[Filesystem fallback]
E --> D
D --> F[Bundle output]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +11, Tests +24. Total +35 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the narrow Git-runner seam and real subprocess fallback comparison, then merge after the remaining exact-head changed-extension check completes successfully. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR removes test latency rather than fixing a reported product failure; current main source directly shows the slow timeout fixture it replaces. Is this the best way to solve the issue? Yes. It separates assertion of the Git timeout policy from a real bundle-process fallback check, retaining behavior coverage without a five-second sleep. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bba57301d9c5. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for exact head
|
|
Merged via squash.
|
What Problem This Solves
The Canvas A2UI bundle regression spends the full five-second production Git timeout proving that stalled tracked-input discovery falls back to filesystem hashing. That one case accounts for essentially the entire six-test file runtime.
Why This Change Was Made
Split the regression at the side-effect boundary it owns:
listTrackedInputFilesnow receives its Git runner explicitly, letting the test prove the exact five-second timeout, SIGKILL policy, command shape, and timeout result classification without sleeping.The production timeout, fallback behavior, hash inputs, and bundle policy are unchanged.
User Impact
Maintainer Canvas test feedback is about five seconds faster while timeout and fallback regressions now fail directly instead of only after a real deadline.
Evidence
Controlled same-Testbox A/B on
tbx_01m055cvpx01134s8q61sn1h3m, with one excluded warmup and two retained samples per state, the same command, one worker, distinct filesystem module caches, import diagnostics, and/usr/bin/time -v:CPU and peak RSS were effectively flat, so this PR makes no resource-usage claim.
Validation:
timeoutoption fails the new owner-boundary assertion immediately.+8/-9; declaration surface:+12/-0; test LOC:+49/-25.Testbox benchmark and hydration: https://github.com/openclaw/openclaw/actions/runs/31944514338
Final post-rebase changed gate: https://github.com/openclaw/openclaw/actions/runs/31945366263
AI-assisted: yes. The change and evidence were reviewed by the maintainer agent and fresh autoreview.