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 9923648cd4 Speed up test execution 9923648cd4 is described below commit 9923648cd4dcbf5e120a1a55db6dd788d03fcff8 Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Jan 31 15:35:09 2025 +0000 Speed up test execution --- test/org/apache/tomcat/websocket/server/TestSlowClient.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/org/apache/tomcat/websocket/server/TestSlowClient.java b/test/org/apache/tomcat/websocket/server/TestSlowClient.java index 5460d4fc78..aa31657218 100644 --- a/test/org/apache/tomcat/websocket/server/TestSlowClient.java +++ b/test/org/apache/tomcat/websocket/server/TestSlowClient.java @@ -19,6 +19,8 @@ package org.apache.tomcat.websocket.server; import java.net.URI; 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; @@ -34,6 +36,7 @@ import org.apache.coyote.AbstractProtocol; import org.apache.tomcat.websocket.TesterFirehoseServer; import org.apache.tomcat.websocket.TesterMessageCountClient.TesterProgrammaticEndpoint; import org.apache.tomcat.websocket.WebSocketBaseTest; +import org.apache.tomcat.websocket.WsSession; public class TestSlowClient extends WebSocketBaseTest { @@ -70,10 +73,10 @@ public class TestSlowClient extends WebSocketBaseTest { count++; } Assert.assertTrue(wsSession.isOpen()); - // Set a short session close timeout (milliseconds) - wsSession.getUserProperties().put( - org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); - 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); // BZ 64848 (non-container thread variant) // Confirm there are no waiting processors --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org