Make NioSocketChannelTest more bullet-proof
Motivation: I had the NioSocketChannelTest.testFlushCloseReentrance() fail sometimes on one of my linux installation. This change let it pass all the time. Modification: Set the SO_SNDBUF to a small value to force split writes Result: Test is passing all the time where it was sometimes fail before.
This commit is contained in:
parent
ee55d34cfe
commit
c9faaa6e3e
@ -21,6 +21,7 @@ import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
||||
import io.netty.util.CharsetUtil;
|
||||
import org.junit.Test;
|
||||
@ -51,6 +52,7 @@ public class NioSocketChannelTest {
|
||||
|
||||
ServerBootstrap sb = new ServerBootstrap();
|
||||
sb.group(group).channel(NioServerSocketChannel.class);
|
||||
sb.childOption(ChannelOption.SO_SNDBUF, 1024);
|
||||
sb.childHandler(new ChannelInboundHandlerAdapter() {
|
||||
@Override
|
||||
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
||||
|
Loading…
Reference in New Issue
Block a user