The suite outgrew one runner: ~656 top-level files (~190k LOC) serialized
through --test-concurrency=4 on a single 4-core leg took ~17-20 min (windows
slowest; measured 1225s on the last full green run). Add a `shard` matrix
dimension to the test job so each leg runs a balanced slice; run-ci-tests.mjs
now partitions deterministically + totally (LPT bin-packing over file size)
so the union of all shards == allFiles and no test is skipped. Same tests,
assertions, env, OS and node versions — zero coverage loss. Wall drops ~3x
(~20 -> ~7 min).
Baseline-log arithmetic (sum of per-test durations vs step wall) proves the
old runner default was already concurrent, so the two-phase split's serial
live phase only idled 3+ cores for 3-4 min without buying stability. Run the
whole suite at explicit concurrency=4 (keeps the LIVE_FILES tripwire), and
move typecheck/kernel/pi-subagents/build into a parallel static-gates job off
the test critical path.
Baseline logs from the pre-PR flow show interleaved output from multiple
test files in the same seconds on ubuntu-latest: current hosted runners are
4-vCPU, so availableParallelism()-1 == 3 and the old flat glob was NOT
serial. The two-phase split isolates spawning suites from pool contention;
it does not turn serial into parallel. Comment-only.
The node built-in runner defaults file concurrency to availableParallelism()-1 == 1 on 2-vCPU runners, so the flat tests/*.test.ts glob ran all 600+ suites strictly serially, each paying a node+tsx spawn in turn. scripts/run-ci-tests.mjs splits the same suites into: live (process-spawning, concurrency=1 — #1248 requires quiet-machine conditions) and pool (everything else, concurrency=4 — no spawners by construction, listen(0) ports, XDG-isolated homes), with a self-check that fails the job when a new spawning suite lands unregistered. Same tests/assertions/env; local npm test untouched. Plus two targeted suite speedups: image-request-budget hoists the shared ~100MB body (5 builds -> 3) and claude-native pre-warms the Windows CA (existing #1807 pattern) in the three remaining fresh-home hook e2e tests.
A transient runner-to-registry ECONNRESET during setup-phase `npm i -g` /
`npm ci` reds an otherwise-green PR with no test code ever running (#2541 run
38032380794; rerun-failed-jobs green on the same head). Root cause: npm's
built-in fetch retry defaults to only 2 tries. Raise it to 5 via a job-level
env block on every job that touches the registry, so a ~10s jitter rides out
instead of aborting setup. Job-level placement covers the global CLI install
AND `npm ci` AND any build-time fetch in that job. Bounded: worst case ~+2 min
of backoff before a genuine sustained outage still fails fast (jobs carry their
own timeout-minutes).
Applied to the 9 e2e/setup workflows with executable registry installs (12
jobs total). Deliberately NOT applied around `npm publish` (artifact/release
lanes): a publish is non-idempotent, so a fetch-retry re-POST can trip E409 /
double-publish, which is worse than the original failure mode. Documents the
required pattern in reference/testing.md so new lanes inherit it.
Closes the three verification gaps left after the #1628 triage: the
unwritable-target wall had no real-chain e2e (only mock-logger unit
tests), the no-op protocol had no local form (a self-built fake baseline
cannot validate the LIVE old updater), and cache-lane doctor ran only
by hand.
- unwritable install dir (posix): chmod 0o555 on the real extracted
install, assert the loud failure + one-per-process location
diagnostic + zero disk flip + no leaked update lock
- real published baseline (BILI_E2E_REAL_BASELINE): download one real
published tarball, prove the live old updater hops onto this dist;
CI resolves the baseline via npm view before the run
- cache-lane doctor: opencode lane layout, doctor --json must resolve
the update target to the running copy