More precise shutdown time test

This commit is contained in:
Trustin Lee 2008-11-25 02:57:04 +00:00
parent c979563dcd
commit 5c494dd045

View File

@ -65,7 +65,7 @@ public class NioClientSocketShutdownTimeTest {
ClientBootstrap b = new ClientBootstrap(new NioClientSocketChannelFactory(e1, e2)); ClientBootstrap b = new ClientBootstrap(new NioClientSocketChannelFactory(e1, e2));
b.getPipeline().addLast("handler", new DummyHandler()); b.getPipeline().addLast("handler", new DummyHandler());
long startTime = System.currentTimeMillis(); long startTime;
try { try {
serverSocket.configureBlocking(false); serverSocket.configureBlocking(false);
@ -82,6 +82,8 @@ public class NioClientSocketShutdownTimeTest {
} }
assertTrue(f.isSuccess()); assertTrue(f.isSuccess());
startTime = System.currentTimeMillis();
f.getChannel().close().awaitUninterruptibly(); f.getChannel().close().awaitUninterruptibly();
} finally { } finally {
assertEquals(0, e1.shutdownNow().size()); assertEquals(0, e1.shutdownNow().size());