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
This commit is contained in:
Sam Berlin 2008-06-07 20:20:09 +00:00
parent fdb6ace290
commit 8c519d0928
1 changed files with 7 additions and 0 deletions

View File

@ -627,6 +627,13 @@ public class TestTSCCMWithServer extends ServerTestBase {
throw new RuntimeException(throwRef.get()); throw new RuntimeException(throwRef.get());
assertFalse(conn.isOpen()); 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()); assertEquals(1, localServer.getAcceptedConnectionCount());
// check that there are no connections available // check that there are no connections available