fix(testing): accept 409 Conflict in Locust state change endpoints#2605
Merged
crivetimihai merged 1 commit intomainfrom Jan 31, 2026
Merged
fix(testing): accept 409 Conflict in Locust state change endpoints#2605crivetimihai merged 1 commit intomainfrom
crivetimihai merged 1 commit intomainfrom
Conversation
Add 409 to allowed response codes for state change endpoints in the Locust load test. Under high concurrency, 409 Conflict is expected behavior due to optimistic locking when multiple users try to toggle the same entity's state simultaneously. Updated endpoints: - set_server_state() - /servers/[id]/state - set_tool_state() - /tools/[id]/state - set_resource_state() - /resources/[id]/state - set_prompt_state() - /prompts/[id]/state - set_gateway_state() - /gateways/[id]/state Closes #2566 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
hughhennelly
pushed a commit
to hughhennelly/mcp-context-forge
that referenced
this pull request
Feb 8, 2026
…BM#2605) Add 409 to allowed response codes for state change endpoints in the Locust load test. Under high concurrency, 409 Conflict is expected behavior due to optimistic locking when multiple users try to toggle the same entity's state simultaneously. Updated endpoints: - set_server_state() - /servers/[id]/state - set_tool_state() - /tools/[id]/state - set_resource_state() - /resources/[id]/state - set_prompt_state() - /prompts/[id]/state - set_gateway_state() - /gateways/[id]/state Closes IBM#2566 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> Signed-off-by: hughhennnelly <hughhennelly06@gmail.com>
kcostell06
pushed a commit
to kcostell06/mcp-context-forge
that referenced
this pull request
Feb 24, 2026
…BM#2605) Add 409 to allowed response codes for state change endpoints in the Locust load test. Under high concurrency, 409 Conflict is expected behavior due to optimistic locking when multiple users try to toggle the same entity's state simultaneously. Updated endpoints: - set_server_state() - /servers/[id]/state - set_tool_state() - /tools/[id]/state - set_resource_state() - /resources/[id]/state - set_prompt_state() - /prompts/[id]/state - set_gateway_state() - /gateways/[id]/state Closes IBM#2566 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
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.
Summary
Problem
When running
make load-test-uiwith 4000 concurrent users, the test reported ~100+ false failures:The 409 errors occur due to race conditions when multiple users try to toggle the same entity's state simultaneously. The server correctly returns 409 Conflict to prevent lost updates - this is proper optimistic locking behavior, not a failure.
Solution
Added 409 to allowed_codes for:
set_server_state()-/servers/[id]/stateset_tool_state()-/tools/[id]/stateset_resource_state()-/resources/[id]/stateset_prompt_state()-/prompts/[id]/stateset_gateway_state()-/gateways/[id]/stateVerification
After the fix, load test shows 0 failures for all state endpoints:
/servers/[id]/state/tools/[id]/state/resources/[id]/state/prompts/[id]/state/gateways/[id]/stateCloses #2566