Use smaller connect timeout to speed up tests.
Motivation: For on tests we expected a ConnectTimeoutException but used the default timeout of 10 seconds. This slows down testing. Modifications: Use connect timeout of 1 second in unit test. Result: Faster execution of unit test.
This commit is contained in:
parent
4095cb253a
commit
d8658989e1
@ -17,6 +17,7 @@ package io.netty.channel.epoll;
|
|||||||
|
|
||||||
import io.netty.bootstrap.Bootstrap;
|
import io.netty.bootstrap.Bootstrap;
|
||||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||||
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.ConnectTimeoutException;
|
import io.netty.channel.ConnectTimeoutException;
|
||||||
import io.netty.channel.EventLoopGroup;
|
import io.netty.channel.EventLoopGroup;
|
||||||
import io.netty.util.CharsetUtil;
|
import io.netty.util.CharsetUtil;
|
||||||
@ -94,6 +95,7 @@ public class EpollSocketTcpMd5Test {
|
|||||||
.handler(new ChannelInboundHandlerAdapter())
|
.handler(new ChannelInboundHandlerAdapter())
|
||||||
.option(EpollChannelOption.TCP_MD5SIG,
|
.option(EpollChannelOption.TCP_MD5SIG,
|
||||||
Collections.<InetAddress, byte[]>singletonMap(NetUtil.LOCALHOST4, BAD_KEY))
|
Collections.<InetAddress, byte[]>singletonMap(NetUtil.LOCALHOST4, BAD_KEY))
|
||||||
|
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 1000)
|
||||||
.connect(server.localAddress()).syncUninterruptibly().channel();
|
.connect(server.localAddress()).syncUninterruptibly().channel();
|
||||||
client.close().syncUninterruptibly();
|
client.close().syncUninterruptibly();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user