Fix intermittent test failure

This commit is contained in:
Trustin Lee 2013-02-11 20:44:37 +09:00
parent 5218f38ed0
commit 00e059b064
2 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@ import org.junit.Test;
import java.net.Socket;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicInteger;
import static org.junit.Assert.*;
@ -111,7 +111,7 @@ public class SocketShutdownOutputByPeerTest extends AbstractServerSocketTest {
private static class TestHandler extends ChannelInboundByteHandlerAdapter {
volatile SocketChannel ch;
final BlockingQueue<Byte> queue = new SynchronousQueue<Byte>();
final BlockingQueue<Byte> queue = new LinkedBlockingQueue<Byte>();
final CountDownLatch halfClosure = new CountDownLatch(1);
final CountDownLatch closure = new CountDownLatch(1);
final AtomicInteger halfClosureCount = new AtomicInteger();

View File

@ -26,7 +26,7 @@ import org.junit.Test;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.LinkedBlockingQueue;
import static org.junit.Assert.*;
@ -79,7 +79,7 @@ public class SocketShutdownOutputBySelfTest extends AbstractClientSocketTest {
private static class TestHandler extends ChannelInboundByteHandlerAdapter {
volatile SocketChannel ch;
final BlockingQueue<Byte> queue = new SynchronousQueue<Byte>();
final BlockingQueue<Byte> queue = new LinkedBlockingQueue<Byte>();
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {