Skip to content

Fix test concurrency limit#2876

Merged
RobinTail merged 2 commits intomasterfrom
rm-concurrency-limit
Aug 6, 2025
Merged

Fix test concurrency limit#2876
RobinTail merged 2 commits intomasterfrom
rm-concurrency-limit

Conversation

@RobinTail
Copy link
Copy Markdown
Owner

@RobinTail RobinTail commented Aug 6, 2025

Due to #2873

Distributing test workspaces to different ports.

Summary by CodeRabbit

  • Chores
    • Updated test suites to use dynamic port assignment with distinct keys for each test variant, improving test reliability.
    • Centralized port management to prevent conflicts between CJS, ESM, and compatibility tests.
    • Removed workspace concurrency restriction from configuration to allow parallel test execution.
    • Adjusted default server port configurations in tests and examples for consistency.

@RobinTail RobinTail added the enhancement New feature or request label Aug 6, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 6, 2025

Walkthrough

The changes update test files and supporting utilities to use a centralized givePort function that manages multiple reserved ports for different test variants. The logic for assigning and checking reserved ports is generalized. The pnpm workspace configuration is also updated by removing the concurrency limit.

Changes

Cohort / File(s) Change Summary
Test Port Assignment Refactor
cjs-test/quick-start.spec.ts, esm-test/quick-start.spec.ts, compat-test/quick-start.spec.ts
Updated tests to use givePort with unique identifiers ("cjs", "esm", "compat") for dynamic port assignment instead of hardcoded or shared identifiers. Adjusted fetch requests and assertions to use the dynamically assigned ports.
Port Utility Enhancement
tools/ports.ts
Refactored givePort to support multiple reserved port names and numbers, returning the correct reserved port for each test variant and avoiding conflicts. Updated function signature and internal logic for generality.
Test Generation Update
tools/make-tests.ts
Modified test generation logic to inject variant-specific givePort calls into test code, centralizing port selection and reducing hardcoding.
Workspace Configuration
pnpm-workspace.yaml
Removed the workspaceConcurrency: 1 setting, allowing for potential parallel execution of tasks.
Example Configuration Update
example/config.ts
Changed server listen port from fixed number to dynamic port obtained via givePort("example").
Express-Zod-API Test Port Updates
express-zod-api/tests/builtin-logger.spec.ts, express-zod-api/tests/index.spec.ts, express-zod-api/tests/server-helpers.spec.ts
Updated hardcoded port values (8090) to 1234 in various test assertions and configurations without altering test logic.

Sequence Diagram(s)

sequenceDiagram
    participant Test as Test Suite (cjs/esm/compat)
    participant Ports as givePort Utility

    Test->>Ports: givePort("cjs"/"esm"/"compat")
    Ports-->>Test: Reserved port number (8091/8092/8093)
    Test->>Server: Start server on assigned port
    Test->>Server: Send HTTP request to assigned port
    Server-->>Test: Respond to request
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

bug, refactoring, coverage

Poem

🐇 Ports for all, no more the same,
Each test now claims its own domain.
With givePort’s wisdom, conflicts flee,
The workspace runs in harmony.
Hopping along, our code’s refined—
A warren of tests, well-aligned!
🌱✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3d114f1 and e9c6c17.

⛔ Files ignored due to path filters (1)
  • express-zod-api/tests/__snapshots__/builtin-logger.spec.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (4)
  • example/config.ts (1 hunks)
  • express-zod-api/tests/builtin-logger.spec.ts (1 hunks)
  • express-zod-api/tests/index.spec.ts (1 hunks)
  • express-zod-api/tests/server-helpers.spec.ts (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • example/config.ts
  • express-zod-api/tests/server-helpers.spec.ts
  • express-zod-api/tests/builtin-logger.spec.ts
  • express-zod-api/tests/index.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build (22.12.0)
  • GitHub Check: Analyze (javascript)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rm-concurrency-limit

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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@RobinTail RobinTail marked this pull request as ready for review August 6, 2025 10:32
@coveralls-official
Copy link
Copy Markdown

coveralls-official Bot commented Aug 6, 2025

Coverage Status

coverage: 100.0%. remained the same
when pulling e9c6c17 on rm-concurrency-limit
into df192b7 on master.

@RobinTail RobinTail merged commit d0457e3 into master Aug 6, 2025
13 checks passed
@RobinTail RobinTail deleted the rm-concurrency-limit branch August 6, 2025 10:55
@RobinTail RobinTail added the refactoring The better way to achieve the same result label Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactoring The better way to achieve the same result

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant