Skip to content

Commit 63d72cf

Browse files
committed
Speed up test execution
Skip timeouts where they can be skipped and reduce them where they can't.
1 parent 1a008a2 commit 63d72cf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
import javax.net.ssl.TrustManagerFactory;
3333

3434
import jakarta.websocket.ClientEndpointConfig;
35+
import jakarta.websocket.CloseReason;
36+
import jakarta.websocket.CloseReason.CloseCodes;
3537
import jakarta.websocket.ContainerProvider;
3638
import jakarta.websocket.MessageHandler;
3739
import jakarta.websocket.Session;
@@ -191,11 +193,9 @@ public void testBug56032() throws Exception {
191193
Assert.fail("There are [" + openConnectionCount + "] connections still open");
192194
}
193195

194-
// Set a short session close timeout (milliseconds)
195-
wsSession.getUserProperties().put(
196-
org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000));
197-
// Close the client session.
198-
wsSession.close();
196+
// Cast so we can force the session to be closed quickly.
197+
CloseReason cr = new CloseReason(CloseCodes.CLOSED_ABNORMALLY, "");
198+
((WsSession) wsSession).doClose(cr, cr, true);
199199
}
200200

201201

test/org/apache/tomcat/websocket/TesterFirehoseServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class TesterFirehoseServer {
4141
public static final String MESSAGE;
4242
public static final int MESSAGE_SIZE = 1024;
4343
public static final int WAIT_TIME_MILLIS = 300000;
44-
public static final int SEND_TIME_OUT_MILLIS = 5000;
44+
public static final int SEND_TIME_OUT_MILLIS = 2000;
4545

4646
public static final String PATH = "/firehose";
4747

0 commit comments

Comments
 (0)