Skip to content

Commit

Permalink
Fix flacky test which was missed when commit 8fe3c83
Browse files Browse the repository at this point in the history
  • Loading branch information
normanmaurer committed May 22, 2016
1 parent 06d76ee commit 26a175c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -769,9 +769,10 @@ public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
}

@Test(timeout = 3000)
public void testHandlerAddedThrowsAndRemovedThrowsException() {
public void testHandlerAddedThrowsAndRemovedThrowsException() throws InterruptedException {
final EventExecutorGroup group1 = new DefaultEventExecutorGroup(1);
try {
final CountDownLatch latch = new CountDownLatch(1);
final Promise<Void> promise = group1.next().newPromise();
final Exception exceptionAdded = new RuntimeException();
final Exception exceptionRemoved = new RuntimeException();
Expand All @@ -785,11 +786,13 @@ public void handlerAdded(ChannelHandlerContext ctx) throws Exception {

@Override
public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
latch.countDown();
throw exceptionRemoved;
}
});
pipeline.addLast(group1, new CheckExceptionHandler(exceptionAdded, promise));
group.register(pipeline.channel()).syncUninterruptibly();
latch.await();
assertNull(pipeline.context(handlerName));
promise.syncUninterruptibly();
} finally {
Expand Down

0 comments on commit 26a175c

Please sign in to comment.