Repository navigation
fix(ci): finish the WebKit end-to-end shard when a hosted runner's apt mirror is slow - #200992
Conversation
AWS-hosted ubuntu-24.04 runners rank us-east-2.ec2.archive.ubuntu.com first in apt's mirror list, and its package pool can trickle so slowly that `playwright install --with-deps webkit` outlasts the 25-minute job limit. apt only leaves a mirror+file entry on errors, not on slow transfers. Both WebKit install steps now download the packages first under a 120 s deadline (download-only, so no dpkg is interrupted), retry once without the first mirror under a 300 s deadline, then install from the downloaded archives without a deadline, restore the mirror list, and fetch the browser. Healthy runners only pay one extra apt index refresh.
Playwright elevates its apt-get through its own sudo, which does not pass on a deadline signal sent from outside, so a timed-out download kept running with the apt archives lock held and the fallback failed with 'Could not get lock'. Running timeout as root puts the whole install-deps process tree in its process group.
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR bounds WebKit dependency downloads and retries a slow first apt mirror before installing packages and the browser. Example: An Ubuntu 24.04 runner downloads packages from its first mirror at 30 KB/s.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a concrete CI stall with a focused shared implementation; no blocking defects remain, and the exact-head CI gate passes. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe CI workflow selects WebKit-dependent Control UI shards, prepares their system packages and browser, then runs the existing browser tests. flowchart TD
A[Selected Control UI shard] --> B[Shared WebKit install script]
B --> C[Bounded package download]
C --> D[Retry remaining mirrors on timeout]
C --> E[Install downloaded packages]
D --> E
E --> F[Restore apt configuration]
F --> G[Install WebKit browser and run tests]
Technical reviewBest possible solution: Use the shared bounded download-and-fallback script while preserving uninterrupted package installation and existing shard selection. Do we have a high-confidence way to reproduce the issue? The body supplies a concrete throttled-mirror reproduction using real apt and Playwright clients; this review inspected source and supplied results without executing target code. Is this the best way to solve the issue? The change repairs mirror selection at the existing installation boundary, shares the implementation between both callers, and avoids interrupting dpkg or increasing runner budgets. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 714129c06ea1. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +18, Config +51. Total +69 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 18, 2026, 12:10 AM ET / 05:10 UTC (Revision 2). |
pnpm on these jobs is a Corepack shim configured through COREPACK_HOME, PNPM_HOME and the pnpm store/cache variables, all of which sudo's environment reset drops. Running it as root could fetch pnpm into root's cache or use a different store. Resolve the Playwright CLI once as the runner user and run only that binary under the root deadline.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…t mirror is slow (openclaw#200992) * fix(ci): get WebKit system packages past a slow hosted archive mirror AWS-hosted ubuntu-24.04 runners rank us-east-2.ec2.archive.ubuntu.com first in apt's mirror list, and its package pool can trickle so slowly that `playwright install --with-deps webkit` outlasts the 25-minute job limit. apt only leaves a mirror+file entry on errors, not on slow transfers. Both WebKit install steps now download the packages first under a 120 s deadline (download-only, so no dpkg is interrupted), retry once without the first mirror under a 300 s deadline, then install from the downloaded archives without a deadline, restore the mirror list, and fetch the browser. Healthy runners only pay one extra apt index refresh. * fix(ci): run the WebKit download deadline as root Playwright elevates its apt-get through its own sudo, which does not pass on a deadline signal sent from outside, so a timed-out download kept running with the apt archives lock held and the fallback failed with 'Could not get lock'. Running timeout as root puts the whole install-deps process tree in its process group. * style(test): format the WebKit install stub * fix(ci): keep pnpm out of the root WebKit download phase pnpm on these jobs is a Corepack shim configured through COREPACK_HOME, PNPM_HOME and the pnpm store/cache variables, all of which sudo's environment reset drops. Running it as root could fetch pnpm into root's cache or use a different store. Resolve the Playwright CLI once as the runner user and run only that binary under the root deadline. (cherry picked from commit 34fea95) Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: Patrick-Erichsen <[email protected]>
Route both existing CI consumers and frozen release E2E through the shared installer, retaining selected-target Playwright and release workflow context. Include the #200992 fixture prerequisite; its installer is already present in the shared action. Node/Bun selected recovery and sibling checks pass. (cherry picked from commit 6fd31f8) Prerequisite: 34fea95 (#200992) Co-authored-by: Free Wortley <[email protected]> Co-authored-by: RomneyDa <[email protected]>
…t mirror is slow (openclaw#200992) * fix(ci): get WebKit system packages past a slow hosted archive mirror AWS-hosted ubuntu-24.04 runners rank us-east-2.ec2.archive.ubuntu.com first in apt's mirror list, and its package pool can trickle so slowly that `playwright install --with-deps webkit` outlasts the 25-minute job limit. apt only leaves a mirror+file entry on errors, not on slow transfers. Both WebKit install steps now download the packages first under a 120 s deadline (download-only, so no dpkg is interrupted), retry once without the first mirror under a 300 s deadline, then install from the downloaded archives without a deadline, restore the mirror list, and fetch the browser. Healthy runners only pay one extra apt index refresh. * fix(ci): run the WebKit download deadline as root Playwright elevates its apt-get through its own sudo, which does not pass on a deadline signal sent from outside, so a timed-out download kept running with the apt archives lock held and the fallback failed with 'Could not get lock'. Running timeout as root puts the whole install-deps process tree in its process group. * style(test): format the WebKit install stub * fix(ci): keep pnpm out of the root WebKit download phase pnpm on these jobs is a Corepack shim configured through COREPACK_HOME, PNPM_HOME and the pnpm store/cache variables, all of which sudo's environment reset drops. Running it as root could fetch pnpm into root's cache or use a different store. Resolve the Playwright CLI once as the runner user and run only that binary under the root deadline.
What Problem This Solves
The Control UI end-to-end shard that runs the WebKit suites (
checks-ui-e2e (1/2)) keeps getting cancelled at its 25-minute limit when it lands on an AWS-hostedubuntu-24.04runner. It never reaches the tests: the "Install selected Control UI E2E WebKit" step is still downloading WebKit's system packages when the job is killed. Another open PR, #200835, hit this on three heads in a row.User Impact
No user-visible change. Contributors whose CI lands on a slow hosted runner get the WebKit shard through in a few minutes instead of a cancelled required check; on healthy runners the step behaves as before.
Why This Change Was Made
The hosted image configures apt with a ranked mirror list (
mirror+file:/etc/apt/apt-mirrors.txt). On the AWS-hosted image (region us-west-2) the first entry isus-east-2.ec2.archive.ubuntu.com, and its package pool trickles. apt only moves to the next mirror on errors, never on slow transfers, soplaywright install --with-deps webkitwaits on it indefinitely.Both WebKit install steps in
ci.ymlnow share one inline script (a YAML anchor):APT::Get::Download-Onlydrop-in,playwright install-deps webkitonly downloads, under a 120 s deadline. Stopping it there is safe because dpkg never runs. The deadline runs as root: Playwright elevates through its ownsudo, which does not pass a signal sent from outside on toapt-get. A deadline outsidesudoleaves the download running with the archives lock held.archive.ubuntu.com/security.ubuntu.com). The retry has a 300 s deadline, and the step fails with an explicit error if that runs out too. On an image without a mirror list, the step keeps waiting without a deadline, as before.playwright install-deps webkitagain without a deadline. That run installs from the downloaded archives. The mirror list is then restored, andplaywright install webkitfetches the browser.The CLI path is resolved once as the runner user (
pnpm --dir ui exec which playwright), so pnpm, a Corepack shim configured through the runner user's environment, never runs as root. Root runs only that Playwright binary. The healthy path costs one extraapt-get update(1 to 9 s in the logs below). No native APT retries, no new actions, no runner placement or timeout changes.Alternatives not taken: restoring the
.debfiles from a cache (like the Chromium action does) has more moving parts and only helps once a warmer has run. Raising the timeout or moving the job to another pool hides the problem.Evidence
Before (step "Install selected Control UI E2E WebKit", recent
ci.ymlruns):azure.archive.ubuntu.com)us-east-2.ec2.archive.ubuntu.com)From a cancelled AWS-hosted job: the indexes arrived fine (
Fetched 13.2 MB in 9s), and in the same jobsecurity.ubuntu.comserved its indexes at full speed. ThenNeed to get 125 MB of archives,fonts-freefont-ttf [5641 kB]alone took 99 s, and 186 packages were still downloading 23 minutes later. The Chromium browser download on the same runner took 8 s, so the runner's network was fine. Only that mirror's package pool was slow. (archive.ubuntu.comandsecurity.ubuntu.comresolve to the same Canonical servers.)After: a reproduction in fresh
ubuntu:24.04containers on a remote test VM, running the step body fromci.ymlwith the real chain: the Node 24.22.1 tarball, pnpm 12.15.0 through a Corepack shim from the repo'spackageManagerpin, real[email protected]in aui/workspace package, and a non-root user with passwordless sudo. apt uses the hosted image's layout: amirror+file:list whose first entry is a local stand-in mirror that serves indexes at full speed and package files at 30 KB/s.::warning::WebKit system packages did not download in 120s from http://127.0.0.1:8080/ubuntu/; retrying with the image's other archive mirrors.,Fetched 216 MB in 9s, install from the downloaded archives (Need to get 0 B/219 MB), WebKit browser downloaded. Whole step: 176 s. Before, it would trickle at 30 KB/sFetched 219 MB in 16s, install from cache, browser download. Whole step: 70 s, no warningIn both cases the mirror list was restored, the drop-in removed, no
apt-getwas left running, the runner user's home had no root-owned files, root's cache stayed empty, and every WebKit system package was installed. An earlier iteration that put the deadline outsidesudofailed this test withE: Could not get lock /var/cache/apt/archives/lock. It is held by process … (apt-get), which is why the deadline runs as root. On real runners the package set is smaller (125 MB) because the image already has many of these packages.Checks run locally:
actionlint,shellcheckon the step body,zizmor1.31.1 with the repo config,scripts/generate-ci-git-owner.mts --check, the composite-input interpolation check, andtest/scripts/ci-ui-browser-dependencies.test.ts(plusci-workflow-completeandci-browser-and-grep-setup). The first test runs the step with stubbedpnpm,idandsudo, and now expects download, install, then browser.Not proven here: the slow path on a real AWS-hosted runner. Both WebKit steps are skipped on this PR's own run: preflight enables the Control UI WebKit step only for UI WebKit-owner paths, and the end-to-end shard installs WebKit only when its selection includes a WebKit suite. Which runner pool a run lands on is also not under the PR's control. The first PR or main run that selects the WebKit suites on an AWS-hosted runner will show it.