Enlarged idle timeout to avoid failures in slower machines.

This commit is contained in:
Simone Bordet 2016-06-13 18:11:07 +02:00
parent 7c0d1ea026
commit 45eac1de69
2 changed files with 9 additions and 4 deletions

View File

@ -23,8 +23,6 @@ import java.io.InputStream;
import java.net.Socket;
import org.eclipse.jetty.http.HttpTester;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.NetworkConnector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.toolchain.test.TestTracker;
@ -38,7 +36,7 @@ public abstract class AbstractConnectHandlerTest
protected Server server;
protected ServerConnector serverConnector;
protected Server proxy;
protected Connector proxyConnector;
protected ServerConnector proxyConnector;
protected ConnectHandler connectHandler;
protected void prepareProxy() throws Exception
@ -76,7 +74,7 @@ public abstract class AbstractConnectHandlerTest
protected Socket newSocket() throws IOException
{
Socket socket = new Socket("localhost", ((NetworkConnector)proxyConnector).getLocalPort());
Socket socket = new Socket("localhost", proxyConnector.getLocalPort());
socket.setSoTimeout(5000);
return socket;
}

View File

@ -573,6 +573,13 @@ public class ConnectHandlerTest extends AbstractConnectHandlerTest
@Test
public void testCONNECTAndPOSTWithBigBody() throws Exception
{
// Use a longer idle timeout since this test
// may take a long time on slower machines.
long idleTimeout = 5 * 60 * 1000;
serverConnector.setIdleTimeout(idleTimeout);
proxyConnector.setIdleTimeout(idleTimeout);
connectHandler.setIdleTimeout(idleTimeout);
String hostPort = "localhost:" + serverConnector.getLocalPort();
String request = "" +