added trap for rare error

This commit is contained in:
Greg Wilkins 2011-11-23 09:39:31 +11:00
parent bff3a5e72e
commit eaa83f29d1
2 changed files with 19 additions and 2 deletions

View File

@ -40,9 +40,9 @@ public class AsyncSslHttpExchangeTest extends SslHttpExchangeTest
@Override
public void testGetWithContentExchange() throws Exception
public void testBigPostWithContentExchange() throws Exception
{
super.testGetWithContentExchange();
super.testBigPostWithContentExchange();
}
}

View File

@ -469,6 +469,23 @@ public class HttpExchangeTest
httpExchange.setRequestContentType("application/data");
httpExchange.setRequestContent(niobuf);
_httpClient.send(httpExchange);
long start=System.currentTimeMillis();
while(!httpExchange.isDone())
{
long now=System.currentTimeMillis();
if ((now-start)>=10000)
{
System.err.println("TEST IS TAKING TOOOOO LONG!!!!!!!!!!!!!!!!!!!!");
System.err.println("CLIENT:");
System.err.println(_httpClient.dump());
System.err.println("SERVER:");
_server.dumpStdErr();
new Throwable().printStackTrace();
break;
}
Thread.sleep(100);
}
status = httpExchange.waitForDone();
assertEquals(HttpExchange.STATUS_COMPLETED, status);
result=httpExchange.getResponseContent();