Skip to content

test: setup a maxForks to avoid "Channel closed" error#1523

Merged
colinaaa merged 2 commits intolynx-family:mainfrom
colinaaa:colin/0813/max-forks
Aug 13, 2025
Merged

test: setup a maxForks to avoid "Channel closed" error#1523
colinaaa merged 2 commits intolynx-family:mainfrom
colinaaa:colin/0813/max-forks

Conversation

@colinaaa
Copy link
Copy Markdown
Collaborator

@colinaaa colinaaa commented Aug 13, 2025

Summary by CodeRabbit

  • Tests

    • Added adaptive, pool-based parallel test execution that automatically scales worker processes based on available CPU capacity to improve test speed and stability across local machines and CI.
  • Chores

    • Updated test runner configuration to enable dynamic pool sizing and more predictable, efficient test runs.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 13, 2025

⚠️ No Changeset found

Latest commit: 1e58df8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 13, 2025

📝 Walkthrough

Walkthrough

Adds pool-based parallelism to the Vitest configuration by setting pool: 'forks', adding poolOptions.forks with minForks: 1 and a computed maxForks using os.availableParallelism(), and importing node:os. No other files or exports changed.

Changes

Cohort / File(s) Summary
Test runner configuration
vitest.config.ts
Added pool: 'forks' and poolOptions.forks with minForks: 1 and a runtime maxForks computed from os.availableParallelism() using a CPU-count formula; added node:os import.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • gaoachao

Poem

I nibble code and count each core,
Forking paths to test and more.
Cores split like clover in the sun,
Rabbity runners, swift and fun. 🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 189d307 and 1e58df8.

📒 Files selected for processing (1)
  • vitest.config.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • vitest.config.ts
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Aug 13, 2025

CodSpeed Performance Report

Merging #1523 will not alter performance

Comparing colinaaa:colin/0813/max-forks (1e58df8) with main (cb6d23c)

Summary

✅ 10 untouched benchmarks

@relativeci
Copy link
Copy Markdown

relativeci bot commented Aug 13, 2025

React Example

#4194 Bundle Size — 237.04KiB (0%).

1e58df8(current) vs cb6d23c main#4175(baseline)

Bundle metrics  no changes
                 Current
#4194
     Baseline
#4175
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 158 158
No change  Duplicate Modules 64 64
No change  Duplicate Code 45.86% 45.86%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#4194
     Baseline
#4175
No change  IMG 145.76KiB 145.76KiB
No change  Other 91.28KiB 91.28KiB

Bundle analysis reportBranch colinaaa:colin/0813/max-forksProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Aug 13, 2025

Web Explorer

#4190 Bundle Size — 344.52KiB (0%).

1e58df8(current) vs cb6d23c main#4171(baseline)

Bundle metrics  Change 1 change
                 Current
#4190
     Baseline
#4171
No change  Initial JS 143.37KiB 143.37KiB
No change  Initial CSS 31.84KiB 31.84KiB
Change  Cache Invalidation 0% 41.61%
No change  Chunks 7 7
No change  Assets 7 7
Change  Modules 212(+0.47%) 211
No change  Duplicate Modules 17 17
No change  Duplicate Code 3.96% 3.96%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#4190
     Baseline
#4171
No change  JS 229.72KiB 229.72KiB
No change  Other 82.95KiB 82.95KiB
No change  CSS 31.84KiB 31.84KiB

Bundle analysis reportBranch colinaaa:colin/0813/max-forksProject dashboard


Generated by RelativeCIDocumentationReport issue

@colinaaa colinaaa marked this pull request as ready for review August 13, 2025 11:27
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cb6d23c and 189d307.

📒 Files selected for processing (1)
  • vitest.config.ts (2 hunks)
🔇 Additional comments (1)
vitest.config.ts (1)

52-72: All Vitest poolOptions checks passed — no action required

  • Vitest v3.2.4 (workspace) fully supports test.pool = 'forks' and poolOptions.forks (minForks/maxForks/etc.).
  • @types/node ^22.17.1 includes the os.availableParallelism() type.
  • All tsconfig.json files have "esModuleInterop": true, so your default import of node:os is valid.

No further changes needed here.

Comment thread vitest.config.ts
Comment thread vitest.config.ts
@colinaaa colinaaa requested review from PupilTong and upupming August 13, 2025 12:10
Comment thread vitest.config.ts
@upupming
Copy link
Copy Markdown
Collaborator

LGTM!

@colinaaa colinaaa merged commit e1152fc into lynx-family:main Aug 13, 2025
45 checks passed
@colinaaa colinaaa deleted the colin/0813/max-forks branch August 13, 2025 12:19
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.

2 participants