ci: webviews dev server files run at once, each on its own warm Vite cache (no bead)
Merged
TE
25d ago+186+186+012345678901234567890123456789-26-26-01234567890123456789
Summary
#19812 fixed a race: files that start a Vite dev server shared one node_modules/.vite, and two running at once lost each other's optimized files. To fix it, #19812 ran all 41 of those files one at a time after the rest, and the web test phase went from 7m18s to 9m44s. This PR keeps them off any shared cache but runs them in parallel again:
- Cache per process: the dev configs (
vite.config.tsand therefore gallery-dev,vite.config.acpmux-pane.mjs,vite.config.settings-page.mjs) takecacheDirfromCMUX_VITE_CACHE_DIR(dev-server/viteCacheDir.mjs). When it's unset, they keep Vite's default. - Warm, then copy:
run-webviews-tests.shfirst runs one file per Vite config (pane, gallery, settings, default), alone. Each warms its config's own cache.- The remaining files then run
CMUX_WEB_TEST_DEV_JOBSat once (default: half the jobs, 4 on react-apps-check). - Each runs on its own copy of its config's warm cache, deleted when it finishes.
- No two processes ever share a cache, and none starts the cold first bundle beside another. Three cold starts at once was the stall the old comment describes.
- Fallback: if a config's warming file fails, its cache can't be trusted, so that config's other files run one at a time on cold caches.
Testing
python3 tests/test_webviews_tests_per_file.py. The fakebunrecords each dev server file's cache, whether it found its config's warm marker, and how many ran at once.- Red on 982afd90b6aa:
test_dev_server_files_run_at_once_each_on_its_own_warm_vite_cachefailed. All 9 files shared one cache (1 != 9). - Green: 6 tests OK.
- Red on 982afd90b6aa:
- shellcheck is clean.
- The real effect, the web phase wall time, is measured by this PR's react-apps-check. Numbers are in the comment below.
Changelog
none
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Restores parallel execution for webviews test files that start a Vite dev server, which #19812 had serialized to fix a race on the shared node_modules/.vite cache at the cost of 2.5 extra minutes on the web test phase.
- Every dev config a test serves now optimizes into the cache
CMUX_VITE_CACHE_DIRnames viadev-server/viteCacheDir.mjs, and the dev server plugin prefers it over its per-port cache, which had been overridingvite.config.tsand leaving default-config files to start cold. A new test resolves each config and asserts itscacheDir. run-webviews-tests.shruns one warming file per config alone, then the remaining dev-server files runCMUX_WEB_TEST_DEV_JOBSat once (default a quarter of the jobs; half was CPU bound on the 8-core runner and broke frame-budget and attach-timing tests), each on its own copy of that config's warm cache, deleted when the file finishes. Files that callcreateServernow count as dev server files, and failed cache copies or cleanups no longer stop the lane.- A config whose warming file fails runs its other files one at a time on cold caches.