Fix SocketShutdownOutputByPeerTest failure
- With half-close enabled, the selector loop was spinning due to uncleared OP_READ flag. - Added some delay to the test for more reliable failure
This commit is contained in:
parent
d8c0bf3be2
commit
9319e3ebd0
@ -64,6 +64,7 @@ public class SocketShutdownOutputByPeerTest extends AbstractServerSocketTest {
|
||||
assertTrue(h.ch.isInputShutdown());
|
||||
assertFalse(h.ch.isOutputShutdown());
|
||||
assertEquals(1, h.closure.getCount());
|
||||
Thread.sleep(100);
|
||||
assertEquals(1, h.halfClosureCount.intValue());
|
||||
} finally {
|
||||
s.close();
|
||||
@ -101,6 +102,7 @@ public class SocketShutdownOutputByPeerTest extends AbstractServerSocketTest {
|
||||
assertTrue(h.ch.isOutputShutdown());
|
||||
|
||||
assertEquals(1, h.halfClosure.getCount());
|
||||
Thread.sleep(100);
|
||||
assertEquals(0, h.halfClosureCount.intValue());
|
||||
} finally {
|
||||
s.close();
|
||||
|
@ -119,6 +119,7 @@ public abstract class AbstractNioByteChannel extends AbstractNioChannel {
|
||||
setInputShutdown();
|
||||
if (isOpen()) {
|
||||
if (Boolean.TRUE.equals(config().getOption(ChannelOption.ALLOW_HALF_CLOSURE))) {
|
||||
key.interestOps(key.interestOps() & ~readInterestOp);
|
||||
pipeline.fireUserEventTriggered(ChannelInputShutdownEvent.INSTANCE);
|
||||
} else {
|
||||
close(voidFuture());
|
||||
|
Loading…
Reference in New Issue
Block a user