diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/SslBytesClientTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/SslBytesClientTest.java index fa917512bfa..afe321511f8 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/SslBytesClientTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/SslBytesClientTest.java @@ -35,6 +35,7 @@ public class SslBytesClientTest extends SslBytesTest threadPool = Executors.newCachedThreadPool(); client = new HttpClient(); + client.setMaxConnectionsPerAddress(1); client.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL); File keyStore = MavenTestingUtils.getTestResourceFile("keystore"); SslContextFactory cf = client.getSslContextFactory(); @@ -44,7 +45,7 @@ public class SslBytesClientTest extends SslBytesTest client.start(); SSLContext sslContext = cf.getSslContext(); - acceptor = (SSLServerSocket)sslContext.getServerSocketFactory().createServerSocket(5870); + acceptor = (SSLServerSocket)sslContext.getServerSocketFactory().createServerSocket(0); int serverPort = acceptor.getLocalPort(); @@ -74,6 +75,7 @@ public class SslBytesClientTest extends SslBytesTest String method = HttpMethods.GET; exchange.setMethod(method); client.send(exchange); + Assert.assertTrue(proxy.awaitClient(5, TimeUnit.SECONDS)); final SSLSocket server = (SSLSocket)acceptor.accept(); server.setUseClientMode(false); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/SslBytesTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/SslBytesTest.java index f66c464297b..4ad5c68c56f 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/SslBytesTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/SslBytesTest.java @@ -97,8 +97,8 @@ public abstract class SslBytesTest public void start() throws Exception { - serverSocket = new ServerSocket(5871); -// serverSocket = new ServerSocket(0); +// serverSocket = new ServerSocket(5871); + serverSocket = new ServerSocket(0); Thread acceptor = new Thread(this); acceptor.start(); server = new Socket(serverHost, serverPort);