@Test(timeout = 2000)
public void promiseDoesNotInfiniteLoop() throws InterruptedException {

    EmbeddedChannel channel = new EmbeddedChannel();
    channel.closeFuture().addListener(new ChannelFutureListener() {
        @Override
        public void operationComplete(ChannelFuture future) throws Exception {
            future.channel().close();
        }
    });
    channel.close().syncUninterruptibly();
}