|
10 | 10 | import io.modelcontextprotocol.spec.McpClientTransport; |
11 | 11 | import io.modelcontextprotocol.spec.McpSchema; |
12 | 12 | import io.modelcontextprotocol.spec.McpTransport; |
| 13 | +import org.junit.jupiter.api.Disabled; |
13 | 14 | import org.junit.jupiter.api.Test; |
14 | 15 | import org.slf4j.Logger; |
15 | 16 | import org.slf4j.LoggerFactory; |
@@ -48,7 +49,7 @@ public abstract class AbstractMcpAsyncClientResiliencyTests { |
48 | 49 |
|
49 | 50 | // Uses the https://github.com/tzolov/mcp-everything-server-docker-image |
50 | 51 | @SuppressWarnings("resource") |
51 | | - static GenericContainer<?> container = new GenericContainer<>("docker.io/tzolov/mcp-everything-server:v2") |
| 52 | + static GenericContainer<?> container = new GenericContainer<>("docker.io/tzolov/mcp-everything-server:v3") |
52 | 53 | .withCommand("node dist/index.js streamableHttp") |
53 | 54 | .withLogConsumer(outputFrame -> System.out.println(outputFrame.getUtf8String())) |
54 | 55 | .withNetwork(network) |
@@ -134,10 +135,13 @@ McpAsyncClient client(McpClientTransport transport, Function<McpClient.AsyncSpec |
134 | 135 | AtomicReference<McpAsyncClient> client = new AtomicReference<>(); |
135 | 136 |
|
136 | 137 | assertThatCode(() -> { |
| 138 | + // Do not advertise roots. Otherwise, the server will list roots during |
| 139 | + // initialization. The client responds asynchronously, and there might be a |
| 140 | + // rest condition in tests where we disconnect right after initialization. |
137 | 141 | McpClient.AsyncSpec builder = McpClient.async(transport) |
138 | 142 | .requestTimeout(getRequestTimeout()) |
139 | 143 | .initializationTimeout(getInitializationTimeout()) |
140 | | - .capabilities(McpSchema.ClientCapabilities.builder().roots(true).build()); |
| 144 | + .capabilities(McpSchema.ClientCapabilities.builder().build()); |
141 | 145 | builder = customizer.apply(builder); |
142 | 146 | client.set(builder.build()); |
143 | 147 | }).doesNotThrowAnyException(); |
|
0 commit comments