Skip to content

fix(ci): finish the WebKit end-to-end shard when a hosted runner's apt mirror is slow - #200992

Merged
freeqaz merged 4 commits into
mainfrom
fix/ci-webkit-deps-slow-mirror
Nov 18, 2026
Merged

freeqaz merged 4 commits into
mainfrom
fix/ci-webkit-deps-slow-mirror

Conversation

@freeqaz

@freeqaz freeqaz commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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-hosted ubuntu-24.04 runner. 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 is us-east-2.ec2.archive.ubuntu.com, and its package pool trickles. apt only moves to the next mirror on errors, never on slow transfers, so playwright install --with-deps webkit waits on it indefinitely.

Both WebKit install steps in ci.yml now share one inline script (a YAML anchor):

  1. With an APT::Get::Download-Only drop-in, playwright install-deps webkit only downloads, under a 120 s deadline. Stopping it there is safe because dpkg never runs. The deadline runs as root: Playwright elevates through its own sudo, which does not pass a signal sent from outside on to apt-get. A deadline outside sudo leaves the download running with the archives lock held.
  2. If the deadline fires and the image has more than one mirror, it drops the first entry for the retry, so apt uses the image's next mirrors (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.
  3. It removes the drop-in and runs playwright install-deps webkit again without a deadline. That run installs from the downloaded archives. The mirror list is then restored, and playwright install webkit fetches 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 extra apt-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 .deb files 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.yml runs):

Runner Step time Result
blacksmith-4vcpu-ubuntu-2404 (4 runs) 18 to 23 s success
ubuntu-24.04, Azure centralus (azure.archive.ubuntu.com) 43 s (125 MB fetched in 9 s, 13.6 MB/s) success
ubuntu-24.04, AWS us-west-2 (us-east-2.ec2.archive.ubuntu.com) 880 s, 1398 s job cancelled

From a cancelled AWS-hosted job: the indexes arrived fine (Fetched 13.2 MB in 9s), and in the same job security.ubuntu.com served its indexes at full speed. Then Need 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.com and security.ubuntu.com resolve to the same Canonical servers.)

After: a reproduction in fresh ubuntu:24.04 containers on a remote test VM, running the step body from ci.yml with the real chain: the Node 24.22.1 tarball, pnpm 12.15.0 through a Corepack shim from the repo's packageManager pin, real [email protected] in a ui/ workspace package, and a non-root user with passwordless sudo. apt uses the hosted image's layout: a mirror+file: list whose first entry is a local stand-in mirror that serves indexes at full speed and package files at 30 KB/s.

Case After
Slow first mirror 120 s deadline, then ::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/s
Healthy first mirror Fetched 219 MB in 16s, install from cache, browser download. Whole step: 70 s, no warning

In both cases the mirror list was restored, the drop-in removed, no apt-get was 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 outside sudo failed this test with E: 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, shellcheck on the step body, zizmor 1.31.1 with the repo config, scripts/generate-ci-git-owner.mts --check, the composite-input interpolation check, and test/scripts/ci-ui-browser-dependencies.test.ts (plus ci-workflow-complete and ci-browser-and-grep-setup). The first test runs the step with stubbed pnpm, id and sudo, 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.

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.
@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@freeqaz
freeqaz marked this pull request as ready for review November 18, 2026 04:28
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: WebKit dependency installation can exhaust the shard's 25-minute job limit before tests start.
  • After: The download stops after 120 seconds, retries the remaining mirrors, and completes installation in the reported container reproduction.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused CI repair with real-client fault reproduction, passing exact-head gates, and no actionable correctness or security findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The body supplies real-client Ubuntu 24.04 terminal results for healthy and throttled mirrors, including fallback recovery, completed installation, and cleanup; actual AWS-hosted slow-mirror execution remains unobserved and is not required for this CI-only change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Contributors encounter cancelled WebKit CI checks because one hosted apt mirror transfers packages too slowly.
Reason: The reported repeated stalls justify a bounded retry at the package-download owner without changing product behavior, test coverage, or runner allocation.

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
Reviewed head: 1be7f0deab21650ac39a4de34ce90d5731eb1362

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Selective WebKit installation keeps the original intent (7c0d407: Add WebKit coverage for existing overlay and focus contracts while retaining selective execution and existing runner budgets.)
  • Separate E2E preparation steps keeps the original intent (fc0e45a: Expose selection, requirement discovery, optional WebKit installation, and runtime preparation as separate phases.)
  • Shard-specific browser dependency test keeps the original intent (c5b37e4: Provision WebKit only for the shard owning a selected WebKit suite.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: Both WebKit install sites use one YAML-anchored script; only the download phase is interrupted, while package installation retains its normal completion behavior. (.github/workflows/ci.yml:2538, 1be7f0deab21)
  • Current main still needs the repair: Fetched main retains the unbounded playwright install --with-deps webkit command at the E2E install site. (.github/workflows/ci.yml:2662, 714129c06ea1)
  • Real-client recovery evidence: The PR body reports fresh Ubuntu 24.04 container runs using real pnpm, Playwright, sudo, and apt with a throttled first mirror; output shows fallback downloads, installation requiring zero additional archive bytes, and browser installation. (1be7f0deab21)
  • Exact-head CI and coverage boundary: The exact-head openclaw/ci-gate, dependency review, security-sensitive review, and actionlint pass; the successful E2E job skipped its WebKit installation, so hosted CI does not itself prove the changed fallback. (1be7f0deab21)
  • Original intent preserved: chore(ui): validate overlay and focus contracts in WebKit #168269 introduced selective WebKit validation, and ci: share full compiler preparation in built source checks #184971 separated preparation phases; this PR preserves their selection, coverage, and job budgets. (.github/workflows/ci.yml:2537, 7c0d4070a293)
  • History and policy inspection: Root and applicable test instructions were read; no additional ancestor instructions or maintainer-notes directory were present. A scoped historical content search encountered an unavailable old blob; verified creation commits and current-main history still establish the relevant ownership. (AGENTS.md:1, 714129c06ea1)

Likely related people:

  • Vincent Koc: Raw commit a53b789 adds test/scripts/ci-ui-browser-dependencies.test.ts:41 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: a53b789d19f1; files: test/scripts/ci-ui-browser-dependencies.test.ts)

PR surface

Tests +18, Config +51. Total +69 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 20 2 +18
Docs 0 0 0 0
Config 1 53 2 +51
Generated 0 0 0 0
Other 0 0 0 0
Total 2 73 4 +69

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.

Label justifications:

  • P2: Slow hosted apt mirrors can prevent a required browser shard from reaching its tests, with limited impact outside contributor CI.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-18T04:45:16.489Z sha 019ad64 :: needs maintainer review before merge. :: none

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.
@freeqaz

freeqaz commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Nov 18, 2026
@freeqaz
freeqaz merged commit 34fea95 into main Nov 18, 2026
112 of 114 checks passed
@freeqaz
freeqaz deleted the fix/ci-webkit-deps-slow-mirror branch November 18, 2026 05:17
roboclaw-bot pushed a commit to jjjhenriksen/openclaw that referenced this pull request Nov 18, 2026
…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]>
RomneyDa added a commit that referenced this pull request Nov 18, 2026
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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant