Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Bordet2014-02-06 10:56:25 +0000
committerSimone Bordet2014-02-06 10:56:25 +0000
commit9356ab46da5a4748b5900b0550265731e8bbb280 (patch)
treea3caee327f671de8cae0c377ef2d7867ef206af9
parent5edf2799e90c3b0beb6cb538e514ed15895cb35b (diff)
downloadorg.eclipse.jetty.project-9356ab46da5a4748b5900b0550265731e8bbb280.tar.gz
org.eclipse.jetty.project-9356ab46da5a4748b5900b0550265731e8bbb280.tar.xz
org.eclipse.jetty.project-9356ab46da5a4748b5900b0550265731e8bbb280.zip
Made test more robust.
The check for the connection being closed may fail spuriously because the notification of CompleteListener happens before the connection is closed.
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
index 87c03e43f7..f7ccdfcf63 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
@@ -1137,6 +1137,10 @@ public class HttpClientTest extends AbstractHttpClientServerTest
ContentResponse response = listener.get(2 * timeout, TimeUnit.MILLISECONDS);
Assert.assertEquals(200, response.getStatus());
+ // The parser notifies end-of-content and therefore the CompleteListener
+ // before closing the connection, so we need to wait before checking
+ // that the connection is closed to avoid races.
+ Thread.sleep(1000);
Assert.assertTrue(((HttpConnectionOverHTTP)connection).isClosed());
}
}

Back to the top