Skip to content

refactor: Skip MCP Memory leak integration test#9358

Merged
carlosrcoelho merged 1 commit into
mainfrom
skip-mcp-memory-leak
Aug 12, 2025
Merged

refactor: Skip MCP Memory leak integration test#9358
carlosrcoelho merged 1 commit into
mainfrom
skip-mcp-memory-leak

Conversation

@edwinjosechittilappilly
Copy link
Copy Markdown
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly commented Aug 12, 2025

This pull request disables all MCP memory leak integration tests in test_mcp_memory_leak.py by adding a skip marker. This is a temporary measure to prevent these tests from running.

  • Test suite changes:
    • Added pytest.mark.skip to the pytestmark list in test_mcp_memory_leak.py, causing all MCP memory leak integration tests to be skipped for now.

Summary by CodeRabbit

  • Tests
    • Temporarily skipped the MCP memory leak integration test suite across the module.
    • Retained existing test timeout configuration while applying the skip.
    • These tests will no longer run in CI or local test runs, reducing test execution scope without affecting runtime behavior or features.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 12, 2025

Walkthrough

The test module src/backend/tests/integration/components/mcp/test_mcp_memory_leak.py now applies both a 300-second thread-based timeout and a skip marker at the module level, causing all tests within the module to be skipped while retaining the timeout annotation.

Changes

Cohort / File(s) Summary of Changes
MCP integration test marks
src/backend/tests/integration/components/mcp/test_mcp_memory_leak.py
Updated module-level pytestmark from a single timeout mark to a list including the timeout and a skip marker, skipping all tests in this module.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • italojohnny
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch skip-mcp-memory-leak

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.

@github-actions github-actions Bot added the refactor Maintenance tasks and housekeeping label Aug 12, 2025
@sonarqubecloud
Copy link
Copy Markdown

@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Aug 12, 2025
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: 0

🧹 Nitpick comments (3)
src/backend/tests/integration/components/mcp/test_mcp_memory_leak.py (3)

20-23: Prefer env-gated skip to allow opt-in runs; optionally add no_blockbuster.

Unconditional skip blocks all runs (including local debugging). Consider an environment-gated skip so CI keeps them off by default while developers can opt-in. Adding no_blockbuster also avoids plugin interference when enabled.

Apply this diff:

 pytestmark = [
     pytest.mark.timeout(300, method="thread"),
-    pytest.mark.skip(reason="Skipping all MCP memory leak integration tests for now."),
+    pytest.mark.skipif(
+        os.getenv("RUN_MCP_MEMORY_LEAK_TESTS") != "1",
+        reason="Temporarily disabled (see issue #<ISSUE_ID>). Set RUN_MCP_MEMORY_LEAK_TESTS=1 to enable.",
+    ),
+    pytest.mark.no_blockbuster,
 ]

20-23: Add a tracking reference in the skip reason (issue link/ID) and a TODO with re-enable criteria.

Helps prevent “skip rot” and makes it clear when and how to re-enable these tests.

I can add the issue link and TODO, or open a tracking issue if one doesn’t exist. Want me to proceed?


274-415: Module-level skip also suppresses unit-like tests; consider splitting them out.

Tests like test_session_manager_server_key_generation, test_session_manager_connectivity_validation, and test_session_manager_cleanup_all don’t require Node/npx and provide valuable coverage. With a module-level skip, they won’t run. Consider moving these into a separate unit test module (e.g., src/backend/tests/unit/components/mcp/test_session_manager.py) so coverage is preserved while integration tests remain skipped.

Please confirm if you prefer me to draft the move (and markers) in a follow-up PR.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 515786c and e19f6e0.

📒 Files selected for processing (1)
  • src/backend/tests/integration/components/mcp/test_mcp_memory_leak.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
{src/backend/**/*.py,tests/**/*.py,Makefile}

📄 CodeRabbit Inference Engine (.cursor/rules/backend_development.mdc)

{src/backend/**/*.py,tests/**/*.py,Makefile}: Run make format_backend to format Python code before linting or committing changes
Run make lint to perform linting checks on backend Python code

Files:

  • src/backend/tests/integration/components/mcp/test_mcp_memory_leak.py
src/backend/tests/**/*.py

📄 CodeRabbit Inference Engine (.cursor/rules/testing.mdc)

src/backend/tests/**/*.py: Unit tests for backend code must be located in the 'src/backend/tests/' directory, with component tests organized by component subdirectory under 'src/backend/tests/unit/components/'.
Test files should use the same filename as the component under test, with an appropriate test prefix or suffix (e.g., 'my_component.py' → 'test_my_component.py').
Use the 'client' fixture (an async httpx.AsyncClient) for API tests in backend Python tests, as defined in 'src/backend/tests/conftest.py'.
When writing component tests, inherit from the appropriate base class in 'src/backend/tests/base.py' (ComponentTestBase, ComponentTestBaseWithClient, or ComponentTestBaseWithoutClient) and provide the required fixtures: 'component_class', 'default_kwargs', and 'file_names_mapping'.
Each test in backend Python test files should have a clear docstring explaining its purpose, and complex setups or mocks should be well-commented.
Test both sync and async code paths in backend Python tests, using '@pytest.mark.asyncio' for async tests.
Mock external dependencies appropriately in backend Python tests to isolate unit tests from external services.
Test error handling and edge cases in backend Python tests, including using 'pytest.raises' and asserting error messages.
Validate input/output behavior and test component initialization and configuration in backend Python tests.
Use the 'no_blockbuster' pytest marker to skip the blockbuster plugin in tests when necessary.
Be aware of ContextVar propagation in async tests; test both direct event loop execution and 'asyncio.to_thread' scenarios to ensure proper context isolation.
Test error handling by mocking internal functions using monkeypatch in backend Python tests.
Test resource cleanup in backend Python tests by using fixtures that ensure proper initialization and cleanup of resources.
Test timeout and performance constraints in backend Python tests using 'asyncio.wait_for' and timing assertions.
Test Langflow's Messag...

Files:

  • src/backend/tests/integration/components/mcp/test_mcp_memory_leak.py
src/backend/**/components/**/*.py

📄 CodeRabbit Inference Engine (.cursor/rules/icons.mdc)

In your Python component class, set the icon attribute to a string matching the frontend icon mapping exactly (case-sensitive).

Files:

  • src/backend/tests/integration/components/mcp/test_mcp_memory_leak.py
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test timeout and performance constraints in backend Python tests using 'asyncio.wait_for' and timing assertions.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Use the 'no_blockbuster' pytest marker to skip the blockbuster plugin in tests when necessary.
📚 Learning: 2025-07-21T14:16:14.125Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Use the 'no_blockbuster' pytest marker to skip the blockbuster plugin in tests when necessary.

Applied to files:

  • src/backend/tests/integration/components/mcp/test_mcp_memory_leak.py
🔇 Additional comments (1)
src/backend/tests/integration/components/mcp/test_mcp_memory_leak.py (1)

20-23: Change aligns with PR goal: module-level skip correctly disables this suite.

The module-level skip is a straightforward way to temporarily disable the MCP memory leak tests and matches the stated PR objective.

@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Aug 12, 2025
@carlosrcoelho carlosrcoelho merged commit 163dabd into main Aug 12, 2025
12 checks passed
@carlosrcoelho carlosrcoelho deleted the skip-mcp-memory-leak branch August 12, 2025 12:26
lucaseduoli pushed a commit that referenced this pull request Aug 22, 2025
lucaseduoli pushed a commit that referenced this pull request Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor Maintenance tasks and housekeeping

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants