Made test more robust on slower machines.
This commit is contained in:
parent
e4249fdd9b
commit
811549a06b
|
@ -466,6 +466,8 @@ public class IdleTimeoutTest extends AbstractTest
|
||||||
@Override
|
@Override
|
||||||
public void succeeded()
|
public void succeeded()
|
||||||
{
|
{
|
||||||
|
// Idle timeout should not fire while receiving.
|
||||||
|
Assert.assertEquals(1, timeoutLatch.getCount());
|
||||||
dataLatch.countDown();
|
dataLatch.countDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -473,7 +475,8 @@ public class IdleTimeoutTest extends AbstractTest
|
||||||
});
|
});
|
||||||
|
|
||||||
Assert.assertTrue(dataLatch.await(5 * idleTimeout, TimeUnit.MILLISECONDS));
|
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
|
@Test
|
||||||
|
@ -568,7 +571,7 @@ public class IdleTimeoutTest extends AbstractTest
|
||||||
ByteBuffer data = ByteBuffer.allocate(FlowControlStrategy.DEFAULT_WINDOW_SIZE + 1);
|
ByteBuffer data = ByteBuffer.allocate(FlowControlStrategy.DEFAULT_WINDOW_SIZE + 1);
|
||||||
stream.data(new DataFrame(stream.getId(), data, true), Callback.NOOP);
|
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)
|
private void sleep(long value)
|
||||||
|
|
Loading…
Reference in New Issue