perf(tests): Improve local unit test performance - #4112
Open
janbuchar wants to merge 3 commits into
Open
Conversation
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.
pnpm testnow runs two vitest projects —unit, thenbrowserfor the files that launch real browsers — each with its own worker cap derived from core count and RAMis-cicheck this replaces has been decorative since vitest renamedminThreads/maxThreads, so runs have been at one fork per core with browsers scattered across all of them for who knows how longplugins.test.tsis Chromium-only by default; CI andtest:fullrun the fullchromium,firefox,webkitviaCRAWLEE_TEST_BROWSERS. Firefox and WebKit were ~94s of that file's ~109s (on my machine).esbuildblock (oxc ignores it and warns on every run)Wall time now floors out on the longest single file rather than on CPU, so extra workers only buy contention: 4 → 12 browser workers measured 127s → 111s for double the processes, and 10 → 16 unit workers measured 43.7s → 45.6s plus two contention failures. Splitting the Puppeteer and Playwright halves of
browser-pool.test.ts(~86s, 88 sequential launches in one file) is the obvious next step if the browser group needs to get faster.