Repository navigation
ci(test): size Vitest workers from measured CI headroom - #152864
Conversation
Use measured CI-only six/eight-worker memory tiers for roomy serial self-hosted jobs. Retain local behavior, actual-host fallback limits, Gateway exclusivity, unproven group caps, and historical timing floors. The twelve predefined Blacksmith probe samples passed; native PR CI remains a separate validation step.
|
🦞👀 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: blocked before merge. Reviewed September 19, 2026, 9:13 AM ET / 13:13 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR sizes CI test workers from measured CPU and memory headroom while retaining conservative limits for constrained runners and unmeasured test groups. Merge readiness⛔ Blocked before merge - 3 items remain The optimization remains useful and is not implemented on current main. No introduced correctness or security defect was found; the documented combined-base validation handoff remains outstanding. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s CI planner groups tests into runner jobs, and the shard executor applies worker limits before launching Vitest. This change connects measured host capacity to those limits without increasing job concurrency. flowchart LR
A[Test inventory] --> B[CI job planner]
B --> C[Group caps and fallback limits]
D[Runner CPU and memory] --> E[Worker scheduler]
C --> F[Shard executor]
E --> F
F --> G[Vitest execution and results]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +279, Docs +63, Config +14, Other +103. Total +459 across 11 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep worker sizing in the shared scheduler, preserve executor fallbacks and sibling caps, and land against a verified combined base. Do we have a high-confidence way to reproduce the issue? Not applicable as a product bug: this is CI capacity tuning, supported by controlled runner measurements and a successful native execution of the reviewed head. Is this the best way to solve the issue? Yes. Reusing the existing scheduler and executor preserves one policy owner, and the fallback metadata protects environments outside the measured capacity envelope. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cbf935baba66. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
) Use measured CI-only six/eight-worker memory tiers for roomy serial self-hosted jobs. Retain local behavior, actual-host fallback limits, Gateway exclusivity, unproven group caps, and historical timing floors. The twelve predefined Blacksmith probe samples passed; native PR CI remains a separate validation step.
What Problem This Solves
Heavy Gateway CI remains capped at two Vitest workers even when Blacksmith supplies eight CPUs and about 31 GiB of RAM. The scheduler, workflow override, compact group pin, and packed-job cap all have to agree before additional workers can reach the tests.
User Impact
The complete 293-file
agentic-gateway-core-2group passed at eight workers with a 253.5-second midpoint, 15.8% below the same-revision three-worker control. Interactive local behavior is unchanged. End-to-end PR CI performance remains unmeasured.Why This Change Was Made
CI autosizing admits six workers at 24–28 GiB and eight at 28–128 GiB with at least eight available CPUs. The worst measured single-plan RSS gives conservative two-plan bounds of 16.98 GiB for six workers and 20.16 GiB for eight, below 75% of the corresponding 24/28 GiB thresholds. The explicit override, load backoff, process memory constraints, free-memory pressure limits, forks limit, and 16-worker cap remain.
Roomy serial self-hosted jobs resolve that policy after runtime preparation. Only core-2 loses its compact pin on Blacksmith/hybrid; its co-located siblings retain their original caps. A plan-carried fallback restores two workers when the executor observes constrained capacity, hosted execution, a frozen target, or overlapping plans. Hosted, frozen, constrained, and overlapping workflow ceilings remain unchanged. Production Gateway admission remains exclusive.
The planner retains conservative historical timing floors while emitting timing identities for the changed worker policy.
config/ci-test-timings.json, runner labels, registration counts, test inventories, assertions, and deadlines are unchanged.Evidence
Blacksmith probe run 35441442486, head
6a23c50cf7d1925cb7e042665edf8a67cfd9645d: six jobs, two predefined samples each, all twelve passed without rerunning failures. Actual allocation: eight CPUs, 30.95 GiB, Node 24.19.0. Resource receipts confirm the listed workers and admitted plan slots. Every single-plan sample ran 293 files; every two-plan sample ran 580 files. Zero unhandled errors.RSS is sampled every two seconds across Vitest-matching processes; the table takes the maximum of both samples. Raw sample artifacts agree with every summary. Two-plan measurements already include both processes, so their aggregate is not multiplied again.
Six workers was slightly faster than eight in these samples (18.9% below the single-plan control). Eight did not improve the combined two-plan wall. Eight satisfies the requested memory admission criterion; this small sample establishes a single-plan improvement, not a precise optimum or a full-workflow speedup. The disposable probe temporarily allowed core-1/core-2 overlap to measure contention; that exception is absent from this PR and the remote probe branch has been deleted.
The probe includes the fixture fix from #152785, now merged as
c30f2063c254cfab4530014a4550d4bb7bdf7e16. The runnable PR CI cycle must include that fix in its tested base.Local validation passed: scheduler, shard executor, planner, and workflow guards; changed-file checks (including scripts/root-test typechecks and boundary guards); explicit type-aware lint with a rejecting Promise canary; formatting; docs sanity; and whitespace checks. Independent branch review found no actionable P0–P2 findings.
Native PR CI
Run 35443456810 passed on head
82535d44f70dc0d41beb7626ad91797239c88c83: 124 successful jobs, nine skipped, zero failures, run attempt 1. The three core-2 jobs automatically selected eight workers on eight-CPU / 30.95-GiB runners. Their descriptors retained the fallback limit and their siblings' two-worker caps. All Gateway core families passed.The latest successful main comparison is 35442446249. All three core-2 file inventories match exactly. Summed core-2 spans fell from 464.779 to 329.924 seconds (29.0%), or 32.8% below the committed 491-second weight. The full workflow took 16m57s versus main's 16m17s, below the earlier 19–23-minute range. The final critical-path bin,
checks-node-compact-large-1, took 15m10s on two CPUs with two workers; its Gateway server-isolated slice consumed 560.380 seconds. Main and PR select different work, so the paired probe remains the controlled worker-count comparison.The emitted compact PR plan remains at 73 rows on hybrid and 76 on Blacksmith, including two dist boundary descriptors. This change adds no persistent jobs or registrations. Workflow Sanity also passed on the head. No workflow or Blacksmith sample was rerun, and the PR remains unmerged with auto-merge disabled.
Landing handoff: this CI run tested synthetic merge
495a030bagainst base297fca0c6184d59836cb70001b193f10115dc9d1. That base predates the final H1 child-retention support-fixture patch from #152785; the Phase 1 probe includes the patch, which is now on main. Refresh and verify the combined base through the maintainer preparation workflow before landing. This lane does not rebase, rerun CI, or merge after its one full validation cycle.