Skip to content

Conversation

@Janpot
Copy link
Member

@Janpot Janpot commented Nov 3, 2025

We have 2 CPUs available for the medium resource class. But having the tests run serially cause a lot of underutiization.

Screenshot 2025-11-03 at 12 52 25

We can fully saturate them instead by sharding our tests and have 2 runs in parallel.

Screenshot 2025-11-03 at 12 55 52

This makes optimal use of the available resources and brings the runtime of this job down by ~35% and thus also the consumed credits. Which brings it right into the ballpark of our second slowest job (test_browser). If we want we can increase resource class to medium+ and add another shard to dip below the runtime of that job.

Screenshot 2025-11-04 at 10 23 54

For the test output it works as follows: --reporter=blob overrides the configured reporters to a representation that can be pieced together with vitest run --merge-reports into what's configured by the vitest config:

We make sure to propagate the exit code afterwards as to make the job fail.

@mui-bot
Copy link

mui-bot commented Nov 3, 2025

Deploy preview: https://deploy-preview-20179--material-ui-x.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 08bacdd

@Janpot Janpot added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). labels Nov 3, 2025
@Janpot Janpot changed the title [code-infra] Experiment: test parallelism [code-infra] Increase JSDOM test parallelism Nov 3, 2025
@Janpot Janpot requested a review from a team November 3, 2025 15:36
@Janpot Janpot marked this pull request as ready for review November 3, 2025 15:36
command: pnpm test:unit:jsdom
command: |
# Fully saturate all the available CPUs by splitting the tests in 1 shard per CPU
pnpm exec concurrently "pnpm test:unit:jsdom --reporter=blob --shard=1/2" "pnpm test:unit:jsdom --reporter=blob --shard=2/2" || TEST_EXIT_CODE=$?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose circleci never implemented a proper way to detect cores 😆

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I'm not mistaken, availableParallelism detects correct amount of logical CPUs in circle ci. just feels a bit like overkill to write a wrapper script for this.

@Janpot Janpot merged commit 0286dd7 into mui:master Nov 3, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants