From 811549a06bd793b172b3b202b66aa515e0e8dd78 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Wed, 13 Jul 2016 20:06:08 +0200 Subject: [PATCH] Made test more robust on slower machines. --- .../org/eclipse/jetty/http2/client/IdleTimeoutTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java index c2e8188445c..3be41221eb7 100644 --- a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java +++ b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java @@ -466,6 +466,8 @@ public class IdleTimeoutTest extends AbstractTest @Override public void succeeded() { + // Idle timeout should not fire while receiving. + Assert.assertEquals(1, timeoutLatch.getCount()); dataLatch.countDown(); } }); @@ -473,7 +475,8 @@ public class IdleTimeoutTest extends AbstractTest }); Assert.assertTrue(dataLatch.await(5 * idleTimeout, TimeUnit.MILLISECONDS)); - Assert.assertFalse(timeoutLatch.await(1, TimeUnit.SECONDS)); + // The server did not send a response, so it will eventually timeout. + Assert.assertTrue(timeoutLatch.await(5 * idleTimeout, TimeUnit.SECONDS)); } @Test @@ -568,7 +571,7 @@ public class IdleTimeoutTest extends AbstractTest ByteBuffer data = ByteBuffer.allocate(FlowControlStrategy.DEFAULT_WINDOW_SIZE + 1); stream.data(new DataFrame(stream.getId(), data, true), Callback.NOOP); - Assert.assertTrue(latch.await(555, TimeUnit.SECONDS)); + Assert.assertTrue(latch.await(5, TimeUnit.SECONDS)); } private void sleep(long value)