From 0dc046ebed0794e69ade8e9d66488ae6a8e1d0bc Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Tue, 21 Oct 2014 14:08:42 +0900 Subject: [PATCH] Increase the timeout of ChannelDeregistrationTest Motivation: When a thread-local random is used first time, it tries to get the initial seed uniquifier from SecureRandom, and it sometimes takes time for the system to have enough entropy. In ChannelDeregistrationTest, the retrieval of the initial seed uniquifier takes place lazily when a new channel is created, and it blocks the channel creation for more than 2 seconds, resulting in test timeouts. Modifications: Increase the timeout of the tests to 5 seconds, because the timeout of the initial seed uniquifier retrieval is 3 seconds. Result: Less flakey tests --- .../java/io/netty/channel/ChannelDeregistrationTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/transport/src/test/java/io/netty/channel/ChannelDeregistrationTest.java b/transport/src/test/java/io/netty/channel/ChannelDeregistrationTest.java index ff3424e1ae..a940074868 100644 --- a/transport/src/test/java/io/netty/channel/ChannelDeregistrationTest.java +++ b/transport/src/test/java/io/netty/channel/ChannelDeregistrationTest.java @@ -73,7 +73,7 @@ public class ChannelDeregistrationTest { * It's important to make sure that they are preserved during and after * {@linkplain io.netty.channel.Channel#deregister()}. */ - @Test(timeout = 2000) + @Test(timeout = 5000) public void testDeregisterFromDifferentEventExecutorGroup() throws Exception { final AtomicBoolean handlerExecuted1 = new AtomicBoolean(); final AtomicBoolean handlerExecuted2 = new AtomicBoolean(); @@ -128,7 +128,7 @@ public class ChannelDeregistrationTest { * Make sure the {@link EventLoop} and {@link ChannelHandlerInvoker} accessible from within a * {@link ChannelHandler} are wrapped by a {@link PausableEventExecutor}. */ - @Test(timeout = 2000) + @Test(timeout = 5000) public void testWrappedEventLoop() throws Exception { final AtomicBoolean channelActiveCalled1 = new AtomicBoolean(); final AtomicBoolean channelActiveCalled2 = new AtomicBoolean(); @@ -205,7 +205,7 @@ public class ChannelDeregistrationTest { /** * See https://github.com/netty/netty/issues/2814 */ - @Test(timeout = 1000) + @Test(timeout = 5000) public void testPromise() { ChannelHandler handler = new TestChannelHandler1(); AbstractChannel ch = new EmbeddedChannel(handler);