Files
webstudio/apps
Oleg Isonen baeaab904f perf: Measure and trim Builder E2E setup (#6699)
Builder E2E still misses the three-minute target. The latest warm
ten-shard run passed, but shard 6 took 4:29 from runner start to
completion. This PR remains a draft.

The ten shard jobs took 2:21–4:29. Their test phases took 1:20–3:31 and
their test durations summed to about 4,018 seconds across 136 tests. At
three Playwright workers per shard, that is a 2:14 average lower bound
before roughly 45–60 seconds of runner setup; some shards have much more
work than average. The latest managed Form consolidation passed on shard
7, but that shard still took 4:06. Shard 5 ranged from 4:40 to 3:20
across two warm runs with no shard 5 code change, so a single run is not
evidence of a stable speedup.

This branch caches the compiled Builder for E2E-only changes and commits
the schema snapshot so shards do not repeat migrations. The separate
Supabase migration job still applies all migrations. Each shard now
restores the compiled Builder cache directly. A warm run confirmed the
artifact wait and download were skipped; a miss run confirmed the
fallback. New runners still restore pnpm, Playwright, and Builder
caches, and start a database.

Related Form redirect, Email, feedback, resource, and managed delivery
outcomes now use fewer generated production Previews while retaining
named steps and assertions. Three generated resource tests now share one
project and Preview; the combined test passed in 52 seconds on CI versus
three prior tests of about 76–79 seconds each. The newest managed Form
test combines navigation, two Action delivery, and multipart upload in
one Preview and passed both locally and in CI.

Four workers per shard were tested and reverted: full E2E rose from 4:46
to 5:32, with 57–64% CPU scheduling pressure on several shards and zero
memory pressure. In the latest shard 7 run, seven generated Preview
startups summed to 200 seconds across parallel tests. Repeated Builder
canvas startup and saves dominate other shards. Caching and small test
consolidations are insufficient for the target; the remaining work needs
a test architecture that keeps production Preview and real Builder
coverage while avoiding full compilation or reload for every behavior
case.

### Status

- [x] Measure per-test, key phase, and runner CPU/memory times.
- [x] Cache compiled Builder inputs and commit a schema snapshot while
retaining the full migration check.
- [x] Keep dashboard UI creation coverage while using faster setup in
unrelated tests.
- [x] Fix the MCP Preview redirect observation race with a regression
test.
- [x] Consolidate related redirect, Email, feedback, resource, and
managed Form outcomes while retaining assertions.
- [x] Verify formatting, Builder typecheck, focused local tests, and the
latest warm ten-shard CI run.
- [ ] Diagnose and eliminate intermittent Chromium startup failures
beyond the concurrent Email binding case.
- [ ] Run managed Form callback protocol and browser checks against one
production Preview.
- [ ] Cut repeated Builder and production Preview work enough for every
shard to finish within three minutes.
- [ ] Verify cold and warm ten-shard CI runs under three minutes.

No user-facing documentation or fixture bundle changes are needed.
2026-11-15 20:38:14 +01:00
..