From 8c519d092887f526e390b7e346d30a4cfa72796b Mon Sep 17 00:00:00 2001 From: Sam Berlin Date: Sat, 7 Jun 2008 20:20:09 +0000 Subject: [PATCH] give server some time to accept for testAbortAfterSocketConnect too git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@664379 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/http/impl/conn/TestTSCCMWithServer.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java b/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java index 0cf6e3419..6d9aeb9cc 100644 --- a/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java +++ b/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java @@ -627,6 +627,13 @@ public void run() { throw new RuntimeException(throwRef.get()); assertFalse(conn.isOpen()); + // Give the server a bit of time to accept the connection, but + // ensure that it can accept it. + for(int i = 0; i < 10; i++) { + if(localServer.getAcceptedConnectionCount() == 1) + break; + Thread.sleep(100); + } assertEquals(1, localServer.getAcceptedConnectionCount()); // check that there are no connections available