Skip to content

Commit

Permalink
Speed up test execution
Browse files Browse the repository at this point in the history
  • Loading branch information
markt-asf committed Jan 31, 2025
1 parent ed39e0a commit 9923648
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/org/apache/tomcat/websocket/server/TestSlowClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
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;
Expand All @@ -34,6 +36,7 @@
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 {

Expand Down Expand Up @@ -70,10 +73,10 @@ public void testSendingFromAppThread() throws Exception {
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
Expand Down

0 comments on commit 9923648

Please sign in to comment.