Index: modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java =================================================================== --- modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java (revision 480858) +++ modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java (working copy) @@ -164,7 +164,7 @@ new MockServer("ServerSocket for HttpURLConnectionTest"); httpServer.start(); synchronized(bound) { - bound.wait(5000); + if (!httpServer.started) bound.wait(5000); } HttpURLConnection c = (HttpURLConnection) new URL("http://127.0.0.1:" + httpServer.port()).openConnection();