Made test more robust on slower machines.

This commit is contained in:
Simone Bordet 2016-07-13 20:06:08 +02:00
parent e4249fdd9b
commit 811549a06b
1 changed files with 5 additions and 2 deletions

View File

@ -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)