diff --git a/transport/src/test/java/io/netty/channel/SingleThreadEventLoopTest.java b/transport/src/test/java/io/netty/channel/SingleThreadEventLoopTest.java index 8f8a3a88eb..11456e2296 100644 --- a/transport/src/test/java/io/netty/channel/SingleThreadEventLoopTest.java +++ b/transport/src/test/java/io/netty/channel/SingleThreadEventLoopTest.java @@ -328,12 +328,29 @@ public class SingleThreadEventLoopTest { @SuppressWarnings("deprecation") public void testRegistrationAfterShutdown() throws Exception { loopA.shutdown(); - Channel channel = new LocalChannel(loopA); - ChannelPromise f = channel.newPromise(); - channel.unsafe().register(f); - f.awaitUninterruptibly(); - assertFalse(f.isSuccess()); - assertThat(f.cause(), is(instanceOf(RejectedExecutionException.class))); + + // Disable logging temporarily. + Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME); + List> appenders = new ArrayList>(); + for (Iterator> i = root.iteratorForAppenders(); i.hasNext();) { + Appender a = i.next(); + appenders.add(a); + root.detachAppender(a); + } + + try { + Channel channel = new LocalChannel(loopA); + ChannelPromise f = channel.newPromise(); + channel.unsafe().register(f); + f.awaitUninterruptibly(); + assertFalse(f.isSuccess()); + assertThat(f.cause(), is(instanceOf(RejectedExecutionException.class))); + assertFalse(channel.isOpen()); + } finally { + for (Appender a: appenders) { + root.addAppender(a); + } + } } @Test(timeout = 10000)