Jetty9 - Made test more robust.
This commit is contained in:
parent
5a3a25c880
commit
bc0f9cd9e6
|
@ -118,13 +118,13 @@ public class IdleTimeoutTest extends AbstractTest
|
|||
});
|
||||
connector.setIdleTimeout(idleTimeout);
|
||||
|
||||
final CountDownLatch latch = new CountDownLatch(1);
|
||||
final CountDownLatch goAwayLatch = new CountDownLatch(1);
|
||||
Session session = startClient(startServer(null), new SessionFrameListener.Adapter()
|
||||
{
|
||||
@Override
|
||||
public void onGoAway(Session session, GoAwayInfo goAwayInfo)
|
||||
{
|
||||
latch.countDown();
|
||||
goAwayLatch.countDown();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -139,7 +139,9 @@ public class IdleTimeoutTest extends AbstractTest
|
|||
});
|
||||
|
||||
Assert.assertTrue(replyLatch.await(3 * idleTimeout, TimeUnit.MILLISECONDS));
|
||||
Assert.assertFalse(latch.await(1000, TimeUnit.MILLISECONDS));
|
||||
|
||||
// Just make sure onGoAway has never been called, but don't wait too much
|
||||
Assert.assertFalse(goAwayLatch.await(idleTimeout / 2, TimeUnit.MILLISECONDS));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue