File tree Expand file tree Collapse file tree
mcp-test/src/test/java/io/modelcontextprotocol/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
2- * Copyright 2024-2025 the original author or authors.
2+ * Copyright 2026-2026 the original author or authors.
33 */
44
55package io .modelcontextprotocol .server ;
3131
3232/**
3333 * Reproduces the flaky McpCompletionTests.testCompletionErrorOnMissingContext failure.
34- *
3534 * Root cause: completion handler throws McpError → server sends error via SSE → SSE write
3635 * fails (connection broken under load) → session removed → next request gets 404.
37- *
3836 * Simulated by abruptly closing the TCP socket inside the handler before throwing.
37+ *
38+ * @author Andrei Shakirin
3939 */
4040class McpCompletionFlakyReproductionTest {
4141
@@ -70,7 +70,7 @@ void teardown() {
7070 }
7171
7272 @ Test
73- void reproduceRaceConditionWithArtificialDelay () throws Exception {
73+ void reproduceRaceConditionWithArtificialDelay () {
7474 var ref = new ResourceReference (ResourceReference .TYPE , "db://{database}/{table}" );
7575 var resource = McpSchema .Resource .builder ().uri ("db://{database}/{table}" ).name ("Database Table" ).build ();
7676
You can’t perform that action at this time.
0 commit comments