Skip to content

[test][python] Avoid forking MCP test server from PyFlink process - #896

Merged
wenjin272 merged 1 commit into
apache:mainfrom
wenjin272:fix-gateway
Jul 13, 2026
Merged

[test][python] Avoid forking MCP test server from PyFlink process#896
wenjin272 merged 1 commit into
apache:mainfrom
wenjin272:fix-gateway

Conversation

@wenjin272

@wenjin272 wenjin272 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Purpose of change

The MCP integration test starts its local MCP server with multiprocessing.Process. In GitHub Actions, this forks the already multi-threaded PyFlink and gRPC test process. The fork can corrupt the shared Py4J gateway, causing later PyFlink calls to fail with errors such as Py4JError: org does not exist in the JVM.

Start each MCP server in a fresh Python subprocess instead, and wait for it to terminate during cleanup. This isolates the server from the PyFlink gateway and avoids leaking server processes between parameterized cases.

Tests

  • ruff check and ruff format --check for the changed Python test
  • MCP integration tests for both server modes
  • MCP integration tests followed by test_durable_execute_basic_flink to verify the PyFlink gateway remains usable
  • Result: 3 passed

API

No public API changes.

Documentation

  • doc-not-needed

Co-authored-by: Codex <codex@openai.com>
@wenjin272 wenjin272 added doc-not-needed Your PR changes do not impact docs fixVersion/0.4.0 labels Jul 13, 2026
@wenjin272 wenjin272 changed the title [python] Avoid forking MCP test server from PyFlink process [test][python] Avoid forking MCP test server from PyFlink process Jul 13, 2026
@wenjin272
wenjin272 marked this pull request as ready for review July 13, 2026 04:10
@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs priority/major Default priority of the PR or issue. and removed doc-not-needed Your PR changes do not impact docs labels Jul 13, 2026
@wenjin272
wenjin272 merged commit 76d48d9 into apache:main Jul 13, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs fixVersion/0.4.0 priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant