From 3684151861618f505179d695624891a239e69cd5 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Fri, 4 Mar 2016 10:40:46 +0100 Subject: [PATCH] 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. --- .../test/java/io/netty/channel/epoll/EpollSocketTcpMd5Test.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketTcpMd5Test.java b/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketTcpMd5Test.java index 2a10607c9b..33cdf87add 100644 --- a/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketTcpMd5Test.java +++ b/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketTcpMd5Test.java @@ -17,6 +17,7 @@ package io.netty.channel.epoll; import io.netty.bootstrap.Bootstrap; import io.netty.channel.ChannelInboundHandlerAdapter; +import io.netty.channel.ChannelOption; import io.netty.channel.ConnectTimeoutException; import io.netty.channel.EventLoopGroup; import io.netty.util.CharsetUtil; @@ -94,6 +95,7 @@ public class EpollSocketTcpMd5Test { .handler(new ChannelInboundHandlerAdapter()) .option(EpollChannelOption.TCP_MD5SIG, Collections.singletonMap(NetUtil.LOCALHOST4, BAD_KEY)) + .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 1000) .connect(server.localAddress()).syncUninterruptibly().channel(); client.close().syncUninterruptibly(); }