netty: NettyServerTest should not hard code ports (#3845)

This commit is contained in:
zpencer 2017-12-07 10:53:28 -08:00 committed by GitHub
parent 8b716a2f18
commit 359e61eb4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -118,8 +118,9 @@ public class NettyServerTest {
final CountDownLatch countDownLatch = new CountDownLatch(1);
InetSocketAddress addr = new InetSocketAddress(0);
NettyServer ns = new NettyServer(
new InetSocketAddress(9999),
addr,
NioServerSocketChannel.class,
channelOptions,
null, // no boss group
@ -154,7 +155,7 @@ public class NettyServerTest {
});
Socket socket = new Socket();
socket.connect(new InetSocketAddress("localhost", 9999), 8000);
socket.connect(new InetSocketAddress("localhost", ns.getPort()), /* timeout= */ 8000);
countDownLatch.await();
socket.close();