Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

ci(admin-browser): install only the headless shell the suite runs on, and size the budget to the job

garrytan48c1f13e0ce2
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 566fab49ae..2c6a966d5e 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -926,7 +926,8 @@ jobs:
working-directory: admin
# The browser download comes from Playwright's CDN, which has served it at
# 250 KB/s (.204, #6613); restoring it keeps most runs off the CDN. The key
- # is the browser revisions the installed Playwright pins.
+ # is the browser revisions the installed Playwright pins. The suite runs
+ # headless, so only the headless shell is installed (114 MiB, not 301).
- name: Restore the pinned Chromium browser
id: playwright-browsers
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
@@ -934,8 +935,8 @@ jobs:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('node_modules/playwright-core/browsers.json') }}
- name: Install the pinned Chromium browser and OS dependencies (bounded, retried once)
- timeout-minutes: 9
- run: bun scripts/ci-bounded-run.ts --idle-s 120 --total-s 480 --retry-s 10 --hint "an apt mirror or browser CDN stall; this normally takes 15-50s" -- bunx playwright install --with-deps chromium
+ timeout-minutes: 10
+ run: bun scripts/ci-bounded-run.ts --idle-s 120 --total-s 560 --retry-s 10 --hint "an apt mirror or browser CDN stall; this normally takes 15-50s" -- bunx playwright install --with-deps --only-shell chromium
- name: Save the pinned Chromium browser
if: steps.playwright-browsers.outputs.cache-hit != 'true'
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ecfd94b262..088e28a0d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,7 +12,7 @@ identifiers and attribution are available in the pre-removal Git revision
## [0.60.206.0] - 2026-10-13
-**CI's Playwright browser install stops on a real stall, finishes a slow download instead of restarting it, and usually skips the CDN.** On master .204 and .205, the `admin-browser` job was cancelled at its 12-minute job timeout. `bunx playwright install --with-deps chromium` crawled through the Chrome download, which Playwright's CDN was serving at about 250 KB/s. A plain per-attempt cap doesn't fix that. The first version of this PR used a 240 s cap and failed on its own CI: the download was still moving (10%, then 30%), and Playwright doesn't resume downloads, so each retry started over from 0%. So a stall now means silence, the whole step has one time budget, and the downloaded browsers are cached. The bounded-run logic from #6594 is now one shared script, and it ends a stalled attempt together with every process the attempt started.
+**CI's Playwright browser install stops on a real stall, finishes a slow download instead of restarting it, and usually skips the CDN.** On master .204 and .205, the `admin-browser` job was cancelled at its 12-minute job timeout. `bunx playwright install --with-deps chromium` crawled through the Chrome download, which Playwright's CDN was serving at about 250 KB/s. A plain per-attempt cap doesn't fix that. The first version of this PR used a 240 s cap and failed on its own CI: the download was still moving (10%, then 30%), and Playwright doesn't resume downloads, so each retry started over from 0%. The second version failed too: its single attempt was still downloading when the 480 s budget ran out, after `apt-get update` alone took 4 minutes at 54 kB/s. So a stall now means silence, the whole step has one time budget sized to the job, only the headless shell the suite uses is downloaded, and the downloaded browser is cached. The bounded-run logic from #6594 is now one shared script, and it ends a stalled attempt together with every process the attempt started.
### Itemized changes
@@ -24,7 +24,8 @@ identifiers and attribution are available in the pre-removal Git revision
- A failure that isn't a stall keeps its own output, is retried once, and is reported with its exit code.
- **`scripts/ci-bun-install.ts`** now delegates to it, with the same environment knobs and the same annotation text. One behavior change: a stalled install's child processes now end with it. Before, only the direct child got SIGKILL, so a backgrounded grandchild outlived the attempt.
- **`admin-browser` (`test.yml`):**
- - `bun scripts/ci-bounded-run.ts --idle-s 120 --total-s 480 --retry-s 10 … -- bunx playwright install --with-deps chromium`, with a `timeout-minutes: 9` step cap. Playwright prints a progress line every 10% of a download, so 120 s of silence is a stall. The job timeout stays at 12 minutes.
+ - `bun scripts/ci-bounded-run.ts --idle-s 120 --total-s 560 --retry-s 10 … -- bunx playwright install --with-deps --only-shell chromium`, with a `timeout-minutes: 10` step cap. Playwright prints a progress line every 10% of a download, so 120 s of silence is a stall. The rest of the job takes under a minute, so the job timeout stays at 12 minutes.
+ - The admin suite runs headless (`admin/playwright.config.ts`), which uses Chrome's headless shell, so `--only-shell` skips the full 187 MiB Chrome. The download drops from 301 MiB to 116 MiB, and the cached directory from 657 MB to 266 MB. Locally, all 13 admin browser tests passed with only the headless shell installed.
- `~/.cache/ms-playwright` is restored before the install and saved after a miss. The cache key is `node_modules/playwright-core/browsers.json`, the browser revisions the installed Playwright pins. On a hit, Playwright finds the browsers and skips the download; the apt dependencies still install.
- **`test/progress.test.ts` cpu_ms diagnostics (no assertion change):** the `< 100` ms check on the idle tick failed once at 101 ms on Bun 1.4.3 CI. Side-by-side probes on 1.4.2 and 1.4.3 ruled out the two version suspects: `process.threadCpuUsage` is still per-thread, and `Atomics.wait` still parks rather than spins. The cause is still unknown, so the assertion and its bound are unchanged. A failure now reports where the CPU went: the thread CPU inside the 200 ms `Atomics.wait` against the tick calls around it, plus the process's minor and major page faults, involuntary context switches and all-thread CPU during the wait. Forcing 110 ms of allocation inside the window shows the split as `112.5 ms inside the 200 ms Atomics.wait, 0.5 ms in the tick calls around it; … 1580 minor and 0 major page faults, 14 involuntary context switches`.
- **Proof:**
diff --git a/test/scripts/ci-bounded-run.test.ts b/test/scripts/ci-bounded-run.test.ts
index 628c38f8b9..11b66b14d9 100644
--- a/test/scripts/ci-bounded-run.test.ts
+++ b/test/scripts/ci-bounded-run.test.ts
@@ -121,7 +121,7 @@ test('the Playwright install is bounded by silence and a total budget that fits
const job = doc.jobs['admin-browser']!;
const at = job.steps.findIndex(entry => entry.run?.includes('playwright install'));
const step = job.steps[at]!;
- const match = /^bun scripts\/ci-bounded-run\.ts --idle-s (\d+) --total-s (\d+) --retry-s \d+ .*-- bunx playwright install --with-deps chromium$/.exec(step.run!);
+ const match = /^bun scripts\/ci-bounded-run\.ts --idle-s (\d+) --total-s (\d+) --retry-s \d+ .*-- bunx playwright install --with-deps --only-shell chromium$/.exec(step.run!);
expect(match).not.toBeNull();
expect(Number(match![1])).toBeLessThan(Number(match![2]));
expect(step['timeout-minutes']! * 60).toBeGreaterThan(Number(match![2]) + 10);