adjust test timeout values

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
Christian Tzolov 2025-03-19 08:27:38 +01:00 • committed by Christian Tzolov
commit 914a14a92a
2 changed files with 33 additions and 14 deletions

View file

@ -63,7 +63,7 @@ public abstract class AbstractMcpAsyncClientTests {
}
protected Duration getInitializationTimeout() {
return Duration.ofSeconds(1);
return Duration.ofSeconds(2);
}
@BeforeEach
@ -90,10 +90,10 @@ public abstract class AbstractMcpAsyncClientTests {
@Test
void testConstructorWithInvalidArguments() {
assertThatThrownBy(() -> McpClient.sync(null).build()).isInstanceOf(IllegalArgumentException.class)
assertThatThrownBy(() -> McpClient.async(null).build()).isInstanceOf(IllegalArgumentException.class)
.hasMessage("Transport must not be null");
assertThatThrownBy(() -> McpClient.sync(mcpTransport).requestTimeout(null).build())
assertThatThrownBy(() -> McpClient.async(mcpTransport).requestTimeout(null).build())
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Request timeout must not be null");
}

View file

@ -48,16 +48,18 @@ public abstract class AbstractMcpSyncClientTests {
abstract protected ClientMcpTransport createMcpTransport();
abstract protected void onStart();
protected void onStart() {
}
abstract protected void onClose();
protected void onClose() {
}
protected Duration getRequestTimeout() {
return Duration.ofSeconds(10);
}
protected Duration getInitializationTimeout() {
return Duration.ofSeconds(1);
return Duration.ofSeconds(2);
}
@BeforeEach