Repository navigation
[code-infra] Trim the shared browser test setup graph - #23426
Merged
LukasTy merged 3 commits intoAug 26, 2026
Merged
Conversation
`test/setupVitest.ts` imported from the `@mui/internal-test-utils` package root, which re-exports `createRenderer` (and with it `react-dom/server`) plus `describeConformance`. With `isolate: false` a page is never reloaded, so that graph was evaluated in every browser page, including the projects that never render anything. `configure` has no subpath export, but `setupVitest` forwards its extra options to `configure`, so the options move into the `setupVitest` call. Also takes `LicenseInfo` from `@mui/x-license/utils/licenseInfo` instead of the package root, which additionally evaluates the provider and telemetry graph. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Every test in the project is gated behind `runIf(isJSDOM)` and the browser config excludes the postinstall tests, so the project opened two browser pages that ran no tests. The coverage is unchanged in jsdom. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
Janpot
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up in the same direction as #23424, but independent of it: the two PRs touch different lines of
test/setupVitest.tsand do not conflict.With
isolate: falsea page is never reloaded, and Vitest keeps every project's pages open until the whole run ends (vitest#10990), so whatever the shared setup imports is evaluated and held by every browser project for the entire run.Changes
test/setupVitest.tsno longer imports from the@mui/internal-test-utilspackage root. The root re-exportscreateRenderer, which statically importsreact-dom/server, plusdescribeConformance- pulled into every page, including the projects that never render anything.configurehas no subpath export, butsetupVitestforwards its extra options straight toconfigure, so those options move into thesetupVitestcall and only@mui/internal-test-utils/envis imported.LicenseInfonow comes from@mui/x-license/utils/licenseInforather than the package root, which additionally evaluates the provider and telemetry graph.Removed
packages/x-telemetry/vitest.config.browser.mts. Every test in that project is gated behindrunIf(isJSDOM)and the browser config excludes the postinstall tests, so the project opened two browser pages that ran no tests at all. Coverage is unchanged in jsdom.Measured
x-internal-gesturespage, post-GC JS heap (CDPHeapProfiler.collectGarbagethenPerformance.getMetrics):Plus two fewer pages from dropping the x-telemetry browser project.
This buys headroom; it does not fix the OOM. The floor is structural: a renderer costs roughly 275 MB of physical footprint of which only about 50 MB is JS heap, and Vitest holds 2 renderers per browser project alive for the whole run (vitest#10990, fix in vitest#10991).
Testing
x-telemetry,x-license,x-date-pickers: 130 passed, 4 skipped.Considered and left out
sinon.restore()into a per-project setup. Sinon is about 341 KB per page and 7 browser projects never import it, but 15 of 21 do. Registering a majority-case cleanup per project is the wrong shape, and it silently drops the restore the first time a package adds a sinon usage. Worth doing only alongside a lint rule that enforces the pairing.import config from 'react-transition-group/config'. Tried it; that entry is a legacy directory import that resolves to CJS, so the default export isundefinedand the whole suite fails withCannot read properties of undefined (reading 'config').configurefrom@testing-library/react/pure.js. That is a different function from@mui/internal-test-utils'sconfigure, which sets MUI's owncomputedStyleSupportsPseudoElementsflag. Swapping them would silently drop that behavior.maxWorkers: 1. Measured: it does not reduce the page count. The run holds 2 renderers per project at both 1 and 2 workers (42 either way), and wall time was unchanged (134.0s vs 135.3s).x-licenseandx-charts-vendorbrowser projects. Unlike x-telemetry, both actually run tests in the browser (3 and 2 files), so removing them is a coverage decision rather than a no-op.