Skip to content

Commit

Permalink
test: increase MCP client timeout to 20s and enable tests
Browse files Browse the repository at this point in the history
- Doubles the default timeout from 10s to 20s in McpAsyncClient
- Updates corresponding timeout values in test classes
- Enables previously disabled async client tests
  • Loading branch information
tzolov committed Dec 12, 2024
1 parent c41f3fe commit a4950c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class McpAsyncClient extends DefaultMcpSession {
};

public McpAsyncClient(McpTransport transport) {
this(transport, Duration.ofSeconds(10), new ObjectMapper());
this(transport, Duration.ofSeconds(20), new ObjectMapper());
}

public McpAsyncClient(McpTransport transport, Duration requestTimeout, ObjectMapper objectMapper) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import reactor.test.StepVerifier;
Expand All @@ -45,15 +44,14 @@
* @author Christian Tzolov
* @author Dariusz Jędrzejczyk
*/
@Disabled
@Timeout(15) // Giving extra time beyond the client timeout
class McpAsyncClientTests {

private McpAsyncClient mcpAsyncClient;

private ServerParameters stdioParams;

private static final Duration TIMEOUT = Duration.ofSeconds(10);
private static final Duration TIMEOUT = Duration.ofSeconds(20);

private static final String TEST_MESSAGE = "Hello MCP Spring AI!";

Expand Down Expand Up @@ -144,7 +142,6 @@ void testListResources() {
}).verifyComplete();
}

@Disabled
@Test
void testMcpAsyncClientState() {
assertThat(mcpAsyncClient).isNotNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class McpSyncClientTests {

private ServerParameters stdioParams;

private static final Duration TIMEOUT = Duration.ofSeconds(10);
private static final Duration TIMEOUT = Duration.ofSeconds(20);

private static final String TEST_MESSAGE = "Hello MCP Spring AI!";

Expand Down

0 comments on commit a4950c0

Please sign in to comment.