Skip to content

Commit 5c3fd2f

Browse files
authored
ci: widen core tooling test stripes (#123636)
1 parent ad400d8 commit 5c3fd2f

4 files changed

Lines changed: 41 additions & 34 deletions

File tree

‎docs/ci.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ The slowest Node test families are split or balanced so each job stays small wit
121121
- Auto-reply runs as balanced workers, with the reply subtree split into agent-runner, commands, dispatch, session, and state-routing shards.
122122
- Agentic gateway/server (control-plane) configs split across chat, auth, model, HTTP/plugin, runtime, and startup lanes instead of waiting on built artifacts.
123123
- Normal CI packs only isolated infra include-pattern shards into deterministic bundles of at most 64 test files, reducing the Node matrix without merging non-isolated command/cron, stateful agents-core, or gateway/server suites. Heavy fixed suites stay on 8 vCPU while most bundled and lower-weight lanes use 4 vCPU. Compact-small bins 2, 5, and 8 use existing 8-vCPU capacity because recent hosted runs showed they repeatedly owned the critical path while the 4-vCPU queue was materially longer; routing happens after packing, so group ownership, coverage, and the existing registration count do not change.
124-
- Pull requests on the canonical repository reuse the changed-test resolver against the synthetic merged-tree diff. Precise changes run one targeted Node job; each selected test file gets its own process so stateful suite isolation remains intact. The planner combines sibling tests with import-graph dependents and falls back to a 31-descriptor metadata-complete compact plan for workspace package, package/lockfile, shared harness, split-config, renamed, or deleted changes, public extension-contract changes, tests with special shard setup, partially resolved or empty targets, oversized path or target plans, and planner errors. Twenty-nine nondist descriptors run as Node jobs; two dist descriptors fold into the built-artifact boundary. That PR fallback retains all four tooling stripes, the isolated tooling shard, and the TUI PTY shard because scripts and PTY owners intentionally require their Go, dist, and environment metadata. Those timing-sensitive groups remain isolated in concurrency-one exclusive bins. Targeted plans always retain the full boundary gate because its repository scanners cannot be derived from imports.
124+
- Pull requests on the canonical repository reuse the changed-test resolver against the synthetic merged-tree diff. Precise changes run one targeted Node job; each selected test file gets its own process so stateful suite isolation remains intact. The planner combines sibling tests with import-graph dependents and falls back to a 32-descriptor metadata-complete compact plan for workspace package, package/lockfile, shared harness, split-config, renamed, or deleted changes, public extension-contract changes, tests with special shard setup, partially resolved or empty targets, oversized path or target plans, and planner errors. Thirty nondist descriptors run as Node jobs; two dist descriptors fold into the built-artifact boundary. That PR fallback retains all five tooling stripes, the isolated tooling shard, and the TUI PTY shard because scripts and PTY owners intentionally require their Go, dist, and environment metadata. Those timing-sensitive groups remain isolated in concurrency-one exclusive bins. Targeted plans always retain the full boundary gate because its repository scanners cannot be derived from imports.
125125
- Canonical `main` pushes use a 25-descriptor Blacksmith integration compact: 24 nondist jobs plus the dist boundary descriptor. They omit the low-signal-per-push tooling and TUI PTY groups while retaining all product-runtime groups, including three file-weighted stripes apiece for unit-src, Control UI, and gateway-core. The Blacksmith 8-vCPU admission target is 200 seconds; the small-runner class retains its measured 276-second admission because lowering it adds registrations without shortening its roughly 202-second balanced bins. Manual dispatches and Full Release Validation retain the full named per-shard matrix. No scheduled workflow currently runs that full Node suite; this is a known coverage-timing gap, not coverage supplied by this compact plan.
126126
- The full Node matrix admits the consistently slow serial tooling, auto-reply command shards, and broad core-fast cache writer first. This keeps the 28-job concurrency cap while preventing critical-path work and the next run's transform seed from slipping into a later wave.
127127
- The three serial Control UI browser shards greedily pack discovered test files by source byte size. This zero-state duration proxy avoids Vitest's equal-file-count hash clustering, automatically accounts for new and changed files, and preserves the same complete test inventory without adding runners.
@@ -226,7 +226,7 @@ Hybrid is the normal degraded-capacity mode. If Blacksmith is down: rerun the fa
226226
gh variable set OPENCLAW_CI_RUNNER_BACKEND --repo openclaw/openclaw --body github
227227
```
228228

229-
Hosted paths use the same setup exercised by manual dispatches and fork pull requests. Blacksmith-only Docker and sticky-disk steps are skipped, dependency setup uses the ordinary Actions pnpm-store cache, and low-memory Android builds use separate Gradle processes. Hybrid attempt-1 Node and plateau lanes deliberately keep this backend-neutral Actions-cache profile when they run on Blacksmith because preflight remains hosted. The exact workspace dependency cache intentionally stays off when preflight is hosted: GitHub can roll the runner image and Node patch between preflight and fanout in one workflow, while the safe exact key then misses; the ordinary store archive is only slightly smaller and pnpm's measured relink is already single-digit seconds. Vitest transform and Node compile caches still use the upstream Actions cache API, which Blacksmith proxies; their Linux-only `runner.os != 'Windows'` conditions do not exclude Blacksmith labels, and the planner still elects one semantic transform-cache writer. Core oxlint splits into five deterministic hosted stripes, with extension/scripts lint and optional UI/format checks in the existing `check-lint` row. The compact Node planner keeps the Blacksmith 200/276-second hint tables unchanged and selects a separate standard 4-core hosted overlay. That overlay contains measured per-group medians, targets 120/124 seconds of serial group work for the large/small source runner classes, and applies a 1.6x median scaling fallback only to unmeasured groups. Failed and timeout-and-retry samples are excluded from refreshes. Groups above 210 predicted seconds split into file-weighted hosted stripes before packing; the refreshed 305-second `core-tooling-1` median now splits that former critical-path pole in two, while the measured `core-tooling-3` outlier retains three stripes. The resulting 55 push descriptors and 64 pull-request fallback descriptors stay within the 64-row cap, and every lane is at or below 209 predicted test seconds. In `github` mode they run hosted; hybrid attempt 1 uses each row's 4-vCPU or 8-vCPU Blacksmith label, while hybrid retries use hosted runners. The corresponding all-Blacksmith plans remain 25 and 31 total descriptors under the 28-row admission cap. Control UI E2E expands from the unchanged all-Blacksmith shape of three Vitest shards plus one browser-extension shard to seven Vitest shards plus one browser-extension shard for the `github` and `hybrid` planner profiles. QA Smoke similarly expands from four parts to six. Hybrid attempt 1 runs those expanded matrices on Blacksmith; `github` mode and hybrid retries use hosted runners. QA's planner reserves the final part's observed roughly two-minute Matrix rider before greedily assigning primary scenarios, keeping that separate run from becoming the tail. Windows expands from the unchanged single Blacksmith job to three hosted jobs with disjoint, project-aligned explicit test lists. This partitions the complete Windows-specific inventory without applying Vitest `--shard` to project-local single-file selections, which Vitest rejects. Expect slower individual builds on standard 4-core hosted runners. Blacksmith's runner-registration budget is irrelevant for hosted jobs, but GitHub-hosted concurrency limits apply.
229+
Hosted paths use the same setup exercised by manual dispatches and fork pull requests. Blacksmith-only Docker and sticky-disk steps are skipped, dependency setup uses the ordinary Actions pnpm-store cache, and low-memory Android builds use separate Gradle processes. Hybrid attempt-1 Node and plateau lanes deliberately keep this backend-neutral Actions-cache profile when they run on Blacksmith because preflight remains hosted. The exact workspace dependency cache intentionally stays off when preflight is hosted: GitHub can roll the runner image and Node patch between preflight and fanout in one workflow, while the safe exact key then misses; the ordinary store archive is only slightly smaller and pnpm's measured relink is already single-digit seconds. Vitest transform and Node compile caches still use the upstream Actions cache API, which Blacksmith proxies; their Linux-only `runner.os != 'Windows'` conditions do not exclude Blacksmith labels, and the planner still elects one semantic transform-cache writer. Core oxlint splits into five deterministic hosted stripes, with extension/scripts lint and optional UI/format checks in the existing `check-lint` row. The compact Node planner keeps separate Blacksmith and standard 4-core hosted hint tables, targets 120/124 seconds of serial group work for the hosted large/small source runner classes, and applies a 1.6x median scaling fallback only to unmeasured groups. Failed and timeout-and-retry samples are excluded from refreshes. Groups above 210 predicted seconds split into file-weighted hosted stripes before packing. The subprocess-heavy tooling family uses five balanced stripes; the 267-second three-way tail observed in run 31789504347 projects to roughly 160 seconds per stripe. The resulting 55 push descriptors and 62 pull-request fallback descriptors stay within the 64-row hosted cap, and every lane is at or below 209 predicted test seconds. In `github` mode compact jobs run hosted; hybrid attempt 1 uses each row's 4-vCPU or 8-vCPU Blacksmith label, while hybrid retries use hosted runners. The corresponding all-Blacksmith plans contain 25 and 32 total descriptors. Control UI E2E expands from the unchanged all-Blacksmith shape of three Vitest shards plus one browser-extension shard to seven Vitest shards plus one browser-extension shard for the `github` and `hybrid` planner profiles. QA Smoke similarly expands from four parts to six. Hybrid attempt 1 runs those expanded matrices on Blacksmith; `github` mode and hybrid retries use hosted runners. QA's planner reserves the final part's observed roughly two-minute Matrix rider before greedily assigning primary scenarios, keeping that separate run from becoming the tail. Windows expands from the unchanged single Blacksmith job to three hosted jobs with disjoint, project-aligned explicit test lists. This partitions the complete Windows-specific inventory without applying Vitest `--shard` to project-local single-file selections, which Vitest rejects. Expect slower individual builds on standard 4-core hosted runners. Blacksmith's runner-registration budget is irrelevant for hosted jobs, but GitHub-hosted concurrency limits apply.
230230

231231
Restore all-Blacksmith routing after an outage by deleting the variable:
232232

‎scripts/lib/ci-node-test-plan.mts‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ const COMPACT_GITHUB_SMALL_NODE_TEST_JOB_SECONDS = 124;
177177
const COMPACT_GITHUB_GROUP_SECONDS_SCALE = 1.6;
178178
const COMPACT_GITHUB_MAX_PREDICTED_SECONDS = 210;
179179
const COMPACT_NODE_TEST_JOB_GROUPS = 10;
180-
const COMPACT_TOOLING_NODE_TEST_GROUPS = 4;
180+
const COMPACT_TOOLING_NODE_TEST_GROUPS = 5;
181181
const COMPACT_WHOLE_NODE_TEST_TIMEOUT_MINUTES = 120;
182182
// Route measured queue-tail bins to existing 8-vCPU capacity after packing so
183183
// the planner keeps the same groups, coverage, and runner-registration count.
@@ -310,10 +310,13 @@ const COMPACT_GROUP_SECONDS_HINTS = new Map<string, number>([
310310
// This dist-only group is outside the sampled nondist logs and retains its
311311
// prior measured hint. The exclusive-bin cap keeps its lane lightly packed.
312312
["core-runtime-tui-pty", 116],
313-
["core-tooling-1", 127],
314-
["core-tooling-2", 121],
315-
["core-tooling-3", 203],
316-
["core-tooling-4", 157],
313+
// Run 31789504347 attempt 1 put the old tooling cohort on the compact tail
314+
// at 267s. Five balanced stripes project that three-way cohort to ~160s.
315+
["core-tooling-1", 160],
316+
["core-tooling-2", 160],
317+
["core-tooling-3", 160],
318+
["core-tooling-4", 160],
319+
["core-tooling-5", 160],
317320
["core-tooling-isolated", 37],
318321
["core-unit-fast-1", 66],
319322
["core-unit-fast-2", 64],
@@ -375,11 +378,11 @@ const COMPACT_LARGE_GROUP_STRIPE_SECONDS_HINTS = new Map<string, number>([
375378

376379
// Rounded medians from standard 4-core GitHub-hosted runs 31737316152,
377380
// 31742781948, 31749838728, 31754493208, 31776290645, 31784022043, and
378-
// 31784883914. The first four runs established the table; the last three
379-
// refresh core-tooling-1 from 299s, 305s, and 311s healthy compact samples.
380-
// Exclude failed samples and reject media-ui-3's 444s compact retry sample
381-
// because its log records a 300s no-output timeout; its three healthy samples
382-
// are 52-63s. Unmeasured groups use the scale above.
381+
// 31784883914. Exclude failed samples and reject media-ui-3's 444s compact
382+
// retry sample because its log records a 300s no-output timeout; its three
383+
// healthy samples are 52-63s. Tooling uses the five-way projection above
384+
// until the reshuffled groups have direct samples. Unmeasured groups use the
385+
// scale above.
383386
const COMPACT_GITHUB_GROUP_SECONDS_HINTS = new Map<string, number>([
384387
["agentic-agents-core-auth", 50],
385388
["agentic-agents-core-isolated", 23],
@@ -485,10 +488,11 @@ const COMPACT_GITHUB_GROUP_SECONDS_HINTS = new Map<string, number>([
485488
["core-runtime-media-ui-support", 101],
486489
["core-runtime-secrets", 73],
487490
["core-runtime-shared", 92],
488-
["core-tooling-1", 305],
489-
["core-tooling-2", 181],
490-
["core-tooling-3", 335],
491-
["core-tooling-4", 183],
491+
["core-tooling-1", 160],
492+
["core-tooling-2", 160],
493+
["core-tooling-3", 160],
494+
["core-tooling-4", 160],
495+
["core-tooling-5", 160],
492496
["core-tooling-isolated", 41],
493497
["core-unit-fast-1", 85],
494498
["core-unit-fast-2", 84],
@@ -554,6 +558,7 @@ const COMPACT_PUSH_EXCLUDED_SHARDS = new Set([
554558
"core-tooling-2",
555559
"core-tooling-3",
556560
"core-tooling-4",
561+
"core-tooling-5",
557562
"core-tooling-isolated",
558563
]);
559564
// Spawn/signal-timing suites (process-group waits, PTY smoke) flake when a
@@ -669,6 +674,7 @@ const FULL_NODE_TEST_ADMISSION_PRIORITY = new Map([
669674
["core-tooling-2", 1],
670675
["core-tooling-3", 1],
671676
["core-tooling-4", 1],
677+
["core-tooling-5", 1],
672678
]);
673679
// Commands and cron run non-isolated, so keep their split shards as separate
674680
// processes. Combining their include lists can retain test state across groups.
@@ -2057,13 +2063,7 @@ function splitOversizedGithubCompactGroup(
20572063
return [{ group, seconds }];
20582064
}
20592065

2060-
// Hosted proof showed the old four-way tooling stripe remained imbalanced
2061-
// after a two-way split (126s versus 246s). Give that measured outlier a
2062-
// third stripe; the generic ceiling remains sufficient for other groups.
2063-
const stripeCount =
2064-
group.shard_name === "core-tooling-3"
2065-
? 3
2066-
: Math.ceil(seconds / COMPACT_GITHUB_MAX_PREDICTED_SECONDS);
2066+
const stripeCount = Math.ceil(seconds / COMPACT_GITHUB_MAX_PREDICTED_SECONDS);
20672067
const splitSeconds = Math.ceil(seconds / stripeCount);
20682068
return createStripedBatches(includePatterns, stripeCount, stripeFileWeight).map(
20692069
(patterns, index) => ({

‎test/scripts/ci-node-test-plan.test.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,14 @@ describe("scripts/lib/ci-node-test-plan.mts", () => {
229229
).toBe(true);
230230
expect(bundled.every((shard) => shard.runner?.startsWith("blacksmith-"))).toBe(true);
231231
expect(bundled).toEqual(createNodeTestShardBundles({ includeReleaseOnlyPluginShards: false }));
232-
expect(bundled.slice(0, 6).map((shard) => shard.shardName)).toEqual([
232+
expect(bundled.slice(0, 7).map((shard) => shard.shardName)).toEqual([
233233
"core-unit-fast-1",
234234
"core-unit-fast-2",
235235
"core-tooling-1",
236236
"core-tooling-2",
237237
"core-tooling-3",
238238
"core-tooling-4",
239+
"core-tooling-5",
239240
]);
240241
expect(bundled.find((shard) => shard.shardName === "core-unit-fast-1")?.runner).toBe(
241242
DEFAULT_NODE_TEST_RUNNER,
@@ -304,14 +305,15 @@ describe("scripts/lib/ci-node-test-plan.mts", () => {
304305
"core-tooling-2",
305306
"core-tooling-3",
306307
"core-tooling-4",
308+
"core-tooling-5",
307309
"core-tooling-isolated",
308310
]);
309311

310312
// Pushes retain three lanes of headroom under the workflow's 28-worker cap.
311313
expect(compact).toHaveLength(25);
312-
expect(pullRequestCompact).toHaveLength(31);
314+
expect(pullRequestCompact).toHaveLength(32);
313315
expect(githubCompact).toHaveLength(55);
314-
expect(githubPullRequestCompact).toHaveLength(64);
316+
expect(githubPullRequestCompact).toHaveLength(62);
315317
expect(hybridCompact).toEqual(githubCompact);
316318
expect(hybridPullRequestCompact).toEqual(githubPullRequestCompact);
317319
expect(githubPullRequestCompact.length).toBeLessThanOrEqual(64);
@@ -600,7 +602,7 @@ describe("scripts/lib/ci-node-test-plan.mts", () => {
600602
.flatMap((shard) => shard.groups)
601603
.filter((group) => /^core-tooling-\d+$/u.test(group.shard_name));
602604
const toolingFiles = toolingGroups.flatMap((group) => group.includePatterns ?? []);
603-
expect(toolingGroups).toHaveLength(4);
605+
expect(toolingGroups).toHaveLength(5);
604606
expect(
605607
toolingGroups.every((group) => group.configs[0] === "test/vitest/vitest.tooling.config.ts"),
606608
).toBe(true);
@@ -770,7 +772,7 @@ describe("scripts/lib/ci-node-test-plan.mts", () => {
770772
);
771773

772774
const stripes = toolingShards.filter((shard) => /^core-tooling-\d+$/u.test(shard.shardName));
773-
expect(stripes).toHaveLength(4);
775+
expect(stripes).toHaveLength(5);
774776
for (const stripe of stripes) {
775777
expect(stripe.configs).toEqual(["test/vitest/vitest.tooling.config.ts"]);
776778
expect(stripe.requiresDist).toBe(false);

‎test/vitest-projects-config.test.ts‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,18 @@ describe("projects vitest config", () => {
147147
const toolingShard = fullSuiteVitestShards.find(
148148
(shard) => shard.config === "test/vitest/vitest.full-core-tooling.config.ts",
149149
);
150-
151-
expect(toolingShard?.projects).toEqual(
152-
expect.arrayContaining(["test/vitest/vitest.tooling-docker.config.ts"]),
153-
);
154-
expect(rootVitestProjects).toEqual(
155-
expect.arrayContaining(["test/vitest/vitest.tooling-docker.config.ts"]),
150+
const toolingProjects = [
151+
"test/vitest/vitest.tooling.config.ts",
152+
"test/vitest/vitest.tooling-docker.config.ts",
153+
"test/vitest/vitest.tooling-isolated.config.ts",
154+
];
155+
156+
expect(toolingShard?.projects).toEqual(toolingProjects);
157+
const rootToolingProjects = rootVitestProjects.filter((project) =>
158+
toolingProjects.includes(project),
156159
);
160+
expect(new Set(rootToolingProjects)).toEqual(new Set(toolingProjects));
161+
expect(rootToolingProjects).toHaveLength(toolingProjects.length);
157162
});
158163

159164
it("disables vite env-file loading for vitest lanes", () => {

0 commit comments

Comments
 (0)