Skip to content

ci(browser-test): cache Playwright browsers + retry install#3296

Draft
kriskowal wants to merge 5 commits into
masterfrom
kriskowal-browser-test-cache
Draft

ci(browser-test): cache Playwright browsers + retry install#3296
kriskowal wants to merge 5 commits into
masterfrom
kriskowal-browser-test-cache

Conversation

@kriskowal

@kriskowal kriskowal commented Jun 3, 2026

Copy link
Copy Markdown
Member

Description

The browser-test job intermittently times out while downloading the Chromium binary from the Playwright CDN, most often right after a Chromium version bump lands before the CDN has finished seeding the new binary. This adds resilience to that step.

The job now caches ~/.cache/ms-playwright keyed on the browser-test lockfile, so a resolved Playwright version bump invalidates the cache on the commit that lands it and any other commit reuses the previously downloaded binaries. The browser install is wrapped in a 3-attempt retry so a single transient CDN download timeout no longer fails the run.

It also pins @playwright/test to an exact 1.58.2. The floating range had been resolving to versions whose Chromium binary downloads from a single-host CDN that runs slow enough to exceed the install timeout, and retrying the same URL yields the same result. 1.58.2 routes browser downloads through mirrored CDNs with failover, which removes the single-mirror failure mode; the exact pin also keeps the lockfile cache key stable so a single cold-cache install per branch is the worst case.

Security Considerations

None. The change only affects how CI provisions browser binaries; it introduces no new authorities and no change to component boundaries.

Scaling Considerations

Reduces CI resource consumption on the common path: cache hits skip the multi-hundred-megabyte browser download entirely.

Documentation Considerations

None. No user-facing or downstream behavior changes.

Testing Considerations

CI-only change; the existing browser-test suite exercises it. No new unit tests are warranted.

Compatibility Considerations

None. No usage patterns change.

Upgrade Considerations

None. No production systems are affected.

Cache Playwright browser binaries between runs, keyed on the browser-test lockfile so a resolved Playwright version bump invalidates the cache. Wrap the browser install in a 3-attempt retry to ride out transient Chromium-CDN download timeouts after a version bump.
@changeset-bot

changeset-bot Bot commented Jun 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7eec2e6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

kriskowal pushed a commit to kriskowal/garden that referenced this pull request Jun 3, 2026
kriscendobot pushed a commit to endojs/endo-but-for-bots that referenced this pull request Jun 3, 2026
Upstream endojs/endo#3296 (the mirror of this PR) is still hitting the
30-minute job ceiling on the cold-cache run. The retry budget alone is
3 attempts x 10 minutes = 30 minutes worst-case install, which leaves
no headroom for setup, build, or the tests themselves.

Bump `timeout-minutes` from 30 to 60 and the retry's `timeout_minutes`
from 10 to 15. Worst-case install becomes 3 x 15 = 45 minutes, fitting
inside the 60-minute job ceiling with room for the rest of the
workflow. Once the cache is populated this is dead weight; on a
cold-cache run (Playwright version bump invalidates the cache) it is
what keeps the job from timing out before tests start.
kriskowal pushed a commit to kriskowal/garden that referenced this pull request Jun 3, 2026
kriskowal pushed a commit to kriskowal/garden that referenced this pull request Jun 3, 2026
kriscendobot pushed a commit to endojs/endo-but-for-bots that referenced this pull request Jun 4, 2026
Upstream endojs/endo#3296 (the mirror of this PR) is still hitting the
30-minute job ceiling on the cold-cache run. The retry budget alone is
3 attempts x 10 minutes = 30 minutes worst-case install, which leaves
no headroom for setup, build, or the tests themselves.

Bump `timeout-minutes` from 30 to 60 and the retry's `timeout_minutes`
from 10 to 15. Worst-case install becomes 3 x 15 = 45 minutes, fitting
inside the 60-minute job ceiling with room for the rest of the
workflow. Once the cache is populated this is dead weight; on a
cold-cache run (Playwright version bump invalidates the cache) it is
what keeps the job from timing out before tests start.
kriskowal pushed a commit to kriskowal/garden that referenced this pull request Jun 4, 2026
kriskowal pushed a commit to kriskowal/garden that referenced this pull request Jun 4, 2026
kriskowal pushed a commit to kriskowal/garden that referenced this pull request Jun 4, 2026
kriskowal pushed a commit to kriskowal/garden that referenced this pull request Jun 4, 2026
kriskowal pushed a commit to kriskowal/garden that referenced this pull request Jun 4, 2026
kriskowal pushed a commit to kriskowal/garden that referenced this pull request Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant