Fix flaky ChannelInitializerTest.testChannelInitializerEventExecutor() (#8738)
Motivation: testChannelInitializerEventExecutor() did sometimes fail as we sometimes miss to count down the latch. This can happen when we remove the handler from the pipeline before channelUnregistered(...) was called for it. Modifications: Countdown the latch in handlerRemoved(...). Result: Fix flaky test.
This commit is contained in:
parent
83b286f5d9
commit
fabc6ee1bc
|
@ -335,7 +335,7 @@ public class ChannelInitializerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void channelUnregistered(ChannelHandlerContext ctx) {
|
public void handlerRemoved(ChannelHandlerContext ctx) {
|
||||||
latch.countDown();
|
latch.countDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -369,6 +369,7 @@ public class ChannelInitializerTest {
|
||||||
client.closeFuture().sync();
|
client.closeFuture().sync();
|
||||||
server.closeFuture().sync();
|
server.closeFuture().sync();
|
||||||
|
|
||||||
|
// Wait until the handler is removed from the pipeline and so no more events are handled by it.
|
||||||
latch.await();
|
latch.await();
|
||||||
|
|
||||||
assertEquals(1, invokeCount.get());
|
assertEquals(1, invokeCount.get());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user