adapt test for 0.10.x and reproduce race conditions with HTTP - #34
Open
mborne wants to merge 5 commits into
Open
adapt test for 0.10.x and reproduce race conditions with HTTP#34mborne wants to merge 5 commits into
mborne wants to merge 5 commits into
Conversation
…e race condition with the MCP server in HTTP mode (refs #33)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several important changes to improve test reliability and support for the upcoming
geocontextversion. The main enhancements are the addition of a test to catch concurrent tool call response crossing, improved session management in test fixtures to avoid this issue, and conditional test/tool logic to support both the current and future versions ofgeocontext. Additionally, test execution is now explicitly set to run sequentially to prevent session-related bugs.Test reliability and concurrency handling: (refs #33)
test_mcp_concurrency.py, a test that verifies concurrent tool calls togeocontextdo not cross their responses, addressing a known issue with HTTP transport in version 0.10.x.mcp_toolsfixture inconftest.pyto ensure only one MCP session per server is used throughout the test session, preventing response crossing during concurrent tool calls.Version compatibility and conditional logic: (refs #27)
config/constants.pyto define new tool names and conditionally include them inEXPECTED_TOOLSwhenGEOCONTEXT_DEVis enabled, supporting both legacy and upcoming tool naming conventions. [1] [2]TOOL_GPF_COUNT_FEATURESinstead ofTOOL_GPF_GET_FEATURESwhenGEOCONTEXT_DEVis enabled, ensuring tests pass with both versions. [1] [2] [3]Test execution configuration: (refs #33)
pyproject.tomlto force pytest to run tests sequentially and disablexdist, ensuring a single MCP session is shared and avoiding concurrency issues with geocontext HTTP transport.