Skip to content

Commit 56c2bdf

Browse files
committed
increase request timeout for integration tests
1 parent f4be7ca commit 56c2bdf

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

mcp-spring/mcp-spring-webflux/src/test/java/io/modelcontextprotocol/WebFluxSseIntegrationTests.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
package io.modelcontextprotocol;
66

7+
import java.time.Duration;
8+
79
import org.junit.jupiter.api.AfterEach;
810
import org.junit.jupiter.api.BeforeEach;
911
import org.springframework.http.server.reactive.HttpHandler;
@@ -39,15 +41,19 @@ class WebFluxSseIntegrationTests extends AbstractMcpClientServerIntegrationTests
3941
@Override
4042
protected void prepareClients(int port, String mcpEndpoint) {
4143

42-
clientBuilders.put("httpclient",
43-
McpClient.sync(HttpClientSseClientTransport.builder("http://localhost:" + PORT)
44-
.sseEndpoint(CUSTOM_SSE_ENDPOINT)
45-
.build()));
44+
clientBuilders
45+
.put("httpclient",
46+
McpClient.sync(HttpClientSseClientTransport.builder("http://localhost:" + PORT)
47+
.sseEndpoint(CUSTOM_SSE_ENDPOINT)
48+
.build()).requestTimeout(Duration.ofHours(10)));
49+
4650
clientBuilders.put("webflux",
4751
McpClient
4852
.sync(WebFluxSseClientTransport.builder(WebClient.builder().baseUrl("http://localhost:" + PORT))
4953
.sseEndpoint(CUSTOM_SSE_ENDPOINT)
50-
.build()));
54+
.build())
55+
.requestTimeout(Duration.ofHours(10)));
56+
5157
}
5258

5359
@Override

mcp-spring/mcp-spring-webflux/src/test/java/io/modelcontextprotocol/WebFluxStreamableIntegrationTests.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
package io.modelcontextprotocol;
66

7+
import java.time.Duration;
8+
79
import org.junit.jupiter.api.AfterEach;
810
import org.junit.jupiter.api.BeforeEach;
911
import org.springframework.http.server.reactive.HttpHandler;
@@ -37,15 +39,18 @@ class WebFluxStreamableIntegrationTests extends AbstractMcpClientServerIntegrati
3739
@Override
3840
protected void prepareClients(int port, String mcpEndpoint) {
3941

40-
clientBuilders.put("httpclient",
41-
McpClient.sync(HttpClientStreamableHttpTransport.builder("http://localhost:" + PORT)
42-
.endpoint(CUSTOM_MESSAGE_ENDPOINT)
43-
.build()));
42+
clientBuilders
43+
.put("httpclient",
44+
McpClient.sync(HttpClientStreamableHttpTransport.builder("http://localhost:" + PORT)
45+
.endpoint(CUSTOM_MESSAGE_ENDPOINT)
46+
.build()).requestTimeout(Duration.ofHours(10)));
4447
clientBuilders.put("webflux",
45-
McpClient.sync(WebClientStreamableHttpTransport
46-
.builder(WebClient.builder().baseUrl("http://localhost:" + PORT))
47-
.endpoint(CUSTOM_MESSAGE_ENDPOINT)
48-
.build()));
48+
McpClient
49+
.sync(WebClientStreamableHttpTransport
50+
.builder(WebClient.builder().baseUrl("http://localhost:" + PORT))
51+
.endpoint(CUSTOM_MESSAGE_ENDPOINT)
52+
.build())
53+
.requestTimeout(Duration.ofHours(10)));
4954
}
5055

5156
@Override

0 commit comments

Comments
 (0)