Skip to content

Commit

Permalink
Speed up test execution
Browse files Browse the repository at this point in the history
Skip timeouts where they can be skipped and reduce them where they
can't.
  • Loading branch information
markt-asf committed Jan 31, 2025
1 parent 1a008a2 commit 63d72cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import javax.net.ssl.TrustManagerFactory;

import jakarta.websocket.ClientEndpointConfig;
import jakarta.websocket.CloseReason;
import jakarta.websocket.CloseReason.CloseCodes;
import jakarta.websocket.ContainerProvider;
import jakarta.websocket.MessageHandler;
import jakarta.websocket.Session;
Expand Down Expand Up @@ -191,11 +193,9 @@ public void testBug56032() throws Exception {
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);
}


Expand Down
2 changes: 1 addition & 1 deletion test/org/apache/tomcat/websocket/TesterFirehoseServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down

0 comments on commit 63d72cf

Please sign in to comment.