Skip to content

fix(testing): accept 409 Conflict in Locust state change endpoints#2605

Merged
crivetimihai merged 1 commit intomainfrom
2566-fix-409-state-change-locust
Jan 31, 2026
Merged

fix(testing): accept 409 Conflict in Locust state change endpoints#2605
crivetimihai merged 1 commit intomainfrom
2566-fix-409-state-change-locust

Conversation

@crivetimihai
Copy link
Copy Markdown
Member

Summary

  • Add 409 to allowed response codes for all 5 state change endpoints in Locust load test
  • Update comments to explain why 409 is acceptable (concurrent state changes due to optimistic locking)

Problem

When running make load-test-ui with 4000 concurrent users, the test reported ~100+ false failures:

CatchResponseError('Expected [200, 403, 404], got 409')

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]/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

Verification

After the fix, load test shows 0 failures for all state endpoints:

Endpoint Requests Failures
/servers/[id]/state 87 0
/tools/[id]/state 74 0
/resources/[id]/state 91 0
/prompts/[id]/state 81 0
/gateways/[id]/state 87 0

Closes #2566

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>
@crivetimihai crivetimihai merged commit 1f6fa1c into main Jan 31, 2026
36 checks passed
@crivetimihai crivetimihai deleted the 2566-fix-409-state-change-locust branch January 31, 2026 12:32
@crivetimihai crivetimihai added this to the Release 1.0.0-RC1 milestone Jan 31, 2026
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>
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.

[TESTING]: Locust load test reports false failures for 409 Conflict on state change endpoints

1 participant