Skip to content

add support for parallel run #739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 23, 2025

Conversation

lk-naath
Copy link
Contributor

@lk-naath lk-naath commented May 16, 2025

@jerome3o-anthropic @jspahrsummers not able to add you guys as reviewer, please help me out here.

Ticket: #736

Added pytest configuration to enable parallel test execution and disable logging during tests for faster and cleaner test runs.

Motivation and Context

Running tests sequentially was causing longer test suite execution times, slowing down development and CI feedback. Enabling parallel test runs with multiple workers improves overall testing speed and efficiency.

How Has This Been Tested?

Tests were run locally with the new configuration enabled. Verified that:

  • Tests execute in parallel across 4 processes.
  • Logging output is disabled during test runs.

Breaking Changes

No breaking changes. This update only affects how tests are executed, not the application code or configurations.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally

Additional context

Uses pytest-xdist plugin for parallel test execution with --numprocesses 4
Disables logging during tests to reduce noise and improve test output clarity.

Reported-by: lekhnath-parajuli-nexyom <[email protected]>
@ihrpr ihrpr added this to the r-05-25 milestone May 20, 2025
Copy link

@mcp-shadow mcp-shadow bot left a comment

Choose a reason for hiding this comment

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

Positive aspects:

Issues and Concerns:

  1. Hardcoded parallelism: Setting --numprocesses 4 hardcodes the parallelism level. This might not be optimal for:
    - CI environments with different CPU counts
    - Developer machines with fewer cores
    - Better to use --numprocesses auto or -n auto to automatically detect CPU count
  2. Warnings suppression: --disable-warnings is problematic:
    - The project already carefully manages warnings with filterwarnings
    - Suppressing all warnings could hide important deprecation or other warnings
    - This conflicts with the existing warning configuration
  3. Logging configuration: The [tool.pytest_env] section is not a standard pytest configuration
    - This might not work as intended
    - Better to use pytest's built-in logging configuration
  4. Verbosity: -vv might be too verbose for regular test runs
    - Could clutter CI output
    - Better left to developer preference via command line

Recommendations:

  1. Change --numprocesses 4 to --numprocesses auto
  2. Remove --disable-warnings to respect existing warning filters
  3. Remove -vv from default options
  4. Remove the [tool.pytest_env] section and use proper pytest logging configuration if needed

Copy link
Contributor

@ihrpr ihrpr left a comment

Choose a reason for hiding this comment

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

Thank you so much for working on this.

Some concerns highlighted in the comments, please can those be addressed?

Reported-by: lekhnath-parajuli-nexyom <[email protected]>
@lk-naath
Copy link
Contributor Author

hey @ihrpr, I've implemented the suggested changes to improve the pytest configuration in pyproject.toml:

  1. Changed --numprocesses 4 to --numprocesses auto to automatically detect and use optimal CPU cores
  2. Removed --disable-warnings to respect the existing warning filters
  3. Removed -vv from default options to reduce verbosity in regular test runs
  4. Removed the non-standard [tool.pytest_env] section

Please review these changes and let me know if you'd like any further adjustments.

Copy link
Contributor

@ihrpr ihrpr left a comment

Choose a reason for hiding this comment

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

Thank you!

@ihrpr ihrpr merged commit d187643 into modelcontextprotocol:main May 23, 2025
11 checks passed
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.

3 participants