Jetty9 - Made test more robust.

This commit is contained in:
Simone Bordet 2012-08-27 09:21:56 +02:00
parent 5a3a25c880
commit bc0f9cd9e6
1 changed files with 5 additions and 3 deletions

View File

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