Skip to content

chore: add cpu limit for playwright tests#1465

Merged
PupilTong merged 1 commit intolynx-family:mainfrom
PupilTong:p/hw/ci-cpu-limit
Aug 7, 2025
Merged

chore: add cpu limit for playwright tests#1465
PupilTong merged 1 commit intolynx-family:mainfrom
PupilTong:p/hw/ci-cpu-limit

Conversation

@PupilTong
Copy link
Copy Markdown
Collaborator

@PupilTong PupilTong commented Aug 7, 2025

Summary by CodeRabbit

  • Refactor
    • Enhanced test execution performance by optimizing how the system determines the number of workers based on CPU capacity and environment settings.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 7, 2025

⚠️ No Changeset found

Latest commit: bef1d30

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 7, 2025

📝 Walkthrough

Walkthrough

The update modifies the logic for setting the workerLimit in the Playwright configuration by introducing a more nuanced calculation based on the system's CPU count and an optional cpu_limit environment variable. The Node.js 'os' module is now imported to access CPU details, replacing the previous, simpler approach.

Changes

Cohort / File(s) Change Summary
Playwright Worker Limit Logic Update
packages/web-platform/web-tests/playwright.config.ts
Imports the Node.js 'os' module and revises the calculation of workerLimit to consider both cpu_limit and actual CPU count, with new logic for systems with more than 32 CPUs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Suggested labels

platform:Web

Poem

A bunny hopped to count each core,
To make the tests run, and never bore.
With CPUs tallied, and limits in mind,
The worker count’s now more refined.
From simple halves to clever math,
This code ensures a speedier path!
🐇💻✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 f36aefe and bef1d30.

📒 Files selected for processing (1)
  • packages/web-platform/web-tests/playwright.config.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/web-platform/web-tests/playwright.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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
  • 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 src/utils.ts and explain its main purpose.
    • @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 comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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.

Documentation and Community

  • 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.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Aug 7, 2025

CodSpeed Performance Report

Merging #1465 will not alter performance

Comparing PupilTong:p/hw/ci-cpu-limit (bef1d30) with main (a54be73)

Summary

✅ 10 untouched benchmarks

@relativeci
Copy link
Copy Markdown

relativeci bot commented Aug 7, 2025

Web Explorer

#3857 Bundle Size — 342.66KiB (0%).

bef1d30(current) vs a54be73 main#3848(baseline)

Bundle metrics  Change 1 change
                 Current
#3857
     Baseline
#3848
No change  Initial JS 142.35KiB 142.35KiB
No change  Initial CSS 31.84KiB 31.84KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 7 7
No change  Assets 7 7
Change  Modules 211(-0.47%) 212
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
#3857
     Baseline
#3848
No change  JS 227.87KiB 227.87KiB
No change  Other 82.95KiB 82.95KiB
No change  CSS 31.84KiB 31.84KiB

Bundle analysis reportBranch PupilTong:p/hw/ci-cpu-limitProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Aug 7, 2025

React Example

#3862 Bundle Size — 235.26KiB (0%).

bef1d30(current) vs a54be73 main#3853(baseline)

Bundle metrics  no changes
                 Current
#3862
     Baseline
#3853
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 159 159
No change  Duplicate Modules 64 64
No change  Duplicate Code 45.81% 45.81%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#3862
     Baseline
#3853
No change  IMG 145.76KiB 145.76KiB
No change  Other 89.5KiB 89.5KiB

Bundle analysis reportBranch PupilTong:p/hw/ci-cpu-limitProject dashboard


Generated by RelativeCIDocumentationReport issue

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 7, 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!

@PupilTong PupilTong requested a review from colinaaa August 7, 2025 12:51
@PupilTong PupilTong merged commit 3151f75 into lynx-family:main Aug 7, 2025
46 checks passed
@PupilTong PupilTong requested a review from Sherry-hue August 8, 2025 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants