Skip to content

ci: improve vitest test parallelism#5898

Draft
killagu wants to merge 1 commit into
nextfrom
egg-16-ci-performance
Draft

ci: improve vitest test parallelism#5898
killagu wants to merge 1 commit into
nextfrom
egg-16-ci-performance

Conversation

@killagu
Copy link
Copy Markdown
Contributor

@killagu killagu commented Apr 26, 2026

Summary

  • Enable Vitest file isolation and cap the in-job test pool so each existing CI runner can use file-level parallelism without adding shared/shard jobs: Linux uses 8 workers, macOS/Windows use 3 workers to avoid resource contention in process-heavy suites.
  • Keep the existing OS/Node test matrix and restore the original coverage behavior for the main test job (ut run ci on every matrix entry, Codecov upload on non-Windows) so Codecov project coverage remains comparable to next.
  • Keep project-level serialization only where tests are known to mutate shared process/global/external-service state: cluster, development, logrotator, mock, onerror, redis, tegg/plugin/tegg, and tegg/plugin/orm.
  • Fix parallel-test fallout found during verification: mock cluster internal port allocation, long Unix-socket paths in the current workspace, and schedule/log timing assumptions.

Local verification

  • Docker Redis 7 and MySQL 8 are running locally; test databases were created before full-suite verification.
  • CI=true pnpm vitest run --bail 1 --retry 2 --testTimeout 20000 --hookTimeout 20000 --coverage --maxWorkers=4 --isolate --reporter=json passed in a clean short-path copy: 1897/1897 suites, 3218 passed, 257 skipped, elapsed 368.36s.
  • CI=true pnpm vitest run --bail 1 --retry 2 --testTimeout 20000 --hookTimeout 20000 --coverage --maxWorkers=8 --isolate --reporter=json passed in a clean short-path copy: 1897/1897 suites, 3218 passed, 257 skipped, elapsed 234.28s.
  • CI=true pnpm vitest run plugins/schedule --isolate --maxWorkers=8 --reporter=dot --silent passed: 23 files passed, 1 skipped, 28 passed, 13 skipped, elapsed 34.72s.
  • CI=true pnpm vitest run plugins/mock/test/cluster.test.ts packages/cluster/test/app_worker.test.ts --isolate --maxWorkers=8 --reporter=dot --silent passed: 2 files passed, 21 passed, 16 skipped, elapsed 80.76s.
  • CI=true pnpm vitest run packages/cluster/test/master/start-master.test.ts --isolate --reporter=dot --silent passed: 1 file passed, 2 passed, 4 skipped, elapsed 1.28s.
  • CI=true pnpm vitest run tegg/plugin/tegg/test --isolate --maxWorkers=8 --reporter=dot passed: 18 files passed, 2 skipped, 51 passed, 2 skipped, elapsed 37.92s.
  • VITEST_MAX_WORKERS=4 CI=true pnpm vitest run ...failed macOS suites... --isolate --reporter=dot --silent passed outside the sandbox: 8 files passed, 83 passed, 22 skipped, elapsed 22.15s.
  • VITEST_MAX_WORKERS=3 CI=true pnpm vitest run plugins/onerror/test/onerror.test.ts plugins/redis/test/redis.test.ts tegg/plugin/orm/test --isolate --reporter=dot --silent passed: 4 files passed, 60 passed, 5 skipped, elapsed 13.34s.
  • CI=true pnpm vitest run --bail 1 --retry 2 --testTimeout 20000 --hookTimeout 20000 --coverage --isolate --maxWorkers=8 --reporter=dot --silent passed in this workspace: 508 files passed, 19 skipped, 3218 passed, 257 skipped, elapsed 547.99s.
  • pnpm oxfmt --check ... passed on changed files.
  • pnpm oxlint --type-aware --type-check --quiet passed for the full repo: 0 errors, 276 existing warnings.

Notes

The latest full-suite run was in the actual Multica workspace. It is slower than the earlier short-path JSON run because it includes coverage and very noisy process logs, but it confirms the complete suite passes with --isolate --maxWorkers=8.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 26, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b9dcfdef-0223-4ac5-a956-06a0e73312b2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch egg-16-ci-performance

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 26, 2026

Deploying egg-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: f32a660
Status: ✅  Deploy successful!
Preview URL: https://0d2f8dac.egg-v3.pages.dev
Branch Preview URL: https://egg-16-ci-performance.egg-v3.pages.dev

View logs

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.96%. Comparing base (fccde5d) to head (f32a660).
⚠️ Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #5898      +/-   ##
==========================================
+ Coverage   85.53%   85.96%   +0.43%     
==========================================
  Files         662        9     -653     
  Lines       18888       57   -18831     
  Branches     3664       11    -3653     
==========================================
- Hits        16155       49   -16106     
+ Misses       2360        7    -2353     
+ Partials      373        1     -372     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 26, 2026

Deploying egg with  Cloudflare Pages  Cloudflare Pages

Latest commit: f32a660
Status: ✅  Deploy successful!
Preview URL: https://f93ec74c.egg-cci.pages.dev
Branch Preview URL: https://egg-16-ci-performance.egg-cci.pages.dev

View logs

@killagu killagu force-pushed the egg-16-ci-performance branch from 1c51916 to 25e35b3 Compare April 27, 2026 02:46
@killagu killagu changed the title ci: reduce test workflow runtime ci: improve vitest test parallelism Apr 27, 2026
@killagu killagu force-pushed the egg-16-ci-performance branch 19 times, most recently from 0bcd094 to be6cd9e Compare May 1, 2026 11:08
@killagu killagu force-pushed the egg-16-ci-performance branch from be6cd9e to f32a660 Compare May 1, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant