This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new 66e0ab5356 Speed up test execution 66e0ab5356 is described below commit 66e0ab53566e0812fe3ad6792a172b029cbd75a7 Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Jan 31 10:10:22 2025 +0000 Speed up test execution Skip timeouts where they can be skipped and reduce them where they can't. --- .../apache/tomcat/websocket/TestWebSocketFrameClientSSL.java | 10 +++++----- test/org/apache/tomcat/websocket/TesterFirehoseServer.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java index f1e89dfa6f..1378638b9b 100644 --- a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java +++ b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java @@ -25,6 +25,8 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import javax.websocket.ClientEndpointConfig; +import javax.websocket.CloseReason; +import javax.websocket.CloseReason.CloseCodes; import javax.websocket.ContainerProvider; import javax.websocket.MessageHandler; import javax.websocket.Session; @@ -158,11 +160,9 @@ public class TestWebSocketFrameClientSSL extends WebSocketBaseTest { Assert.fail("There are [" + openConnectionCount + "] connections still open"); } - // Set a short session close timeout (milliseconds) - wsSession.getUserProperties().put( - org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); - // Close the client session. - wsSession.close(); + // Cast so we can force the session to be closed quickly. + CloseReason cr = new CloseReason(CloseCodes.CLOSED_ABNORMALLY, ""); + ((WsSession) wsSession).doClose(cr, cr, true); } @Override diff --git a/test/org/apache/tomcat/websocket/TesterFirehoseServer.java b/test/org/apache/tomcat/websocket/TesterFirehoseServer.java index f2b90d560e..f41dd5e48a 100644 --- a/test/org/apache/tomcat/websocket/TesterFirehoseServer.java +++ b/test/org/apache/tomcat/websocket/TesterFirehoseServer.java @@ -41,7 +41,7 @@ public class TesterFirehoseServer { public static final String MESSAGE; public static final int MESSAGE_SIZE = 1024; public static final int WAIT_TIME_MILLIS = 300000; - public static final int SEND_TIME_OUT_MILLIS = 5000; + public static final int SEND_TIME_OUT_MILLIS = 2000; public static final String PATH = "/firehose"; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org